registerTool should return registered tool instead of undefined
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- api
Research direction
Start at the registerTool() and executeTool() API definitions and their existing tests; the issue does not name specific files. Check how registration currently resolves and what object executeTool() accepts, then add or update a test for passing the returned tool directly to executeTool(). Done when registration returns the registered tool and the example workflow works.
Written by the indexing model from the issue text.
Description
When registering and executing tools, I often see boilerplate code that requires an extra call to getTools().
await document.modelContext.registerTool({
name: "tool",
description: "A tool",
execute: () => {},
});
const [tool] = await document.modelContext.getTools();
await document.modelContext.executeTool(tool, "{}");
Could we simplify this workflow by having registerTool() return the registered tool object directly? That way, we can pass it straight into executeTool() without the extra lookup step (which is not required by the way).
const tool = await document.modelContext.registerTool({
name: "tool",
description: "A tool",
execute: () => {},
});
await document.modelContext.executeTool(tool, "{}");
- Dominant language
- Bikeshed
- Stars
- 4.7k
- Forks
- 328
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 16
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from webmachinelearning/webmcp
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
webmachinelearning/webmcp#360 · 1 comment ·
Maintainers usually reply within 1 day
-
Say how an agent should weigh annotations that the page wrote about itselfPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
webmachinelearning/webmcp#353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
webmachinelearning/webmcp#343 · 1 reaction ·
Maintainers usually reply within 1 day
-
Agenda+ i18n-tracker
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
webmachinelearning/webmcp#273 · 3 comments ·
Maintainers usually reply within 1 day
-
a11y-tracker Agenda+
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
webmachinelearning/webmcp#272 · 4 comments · 2 reactions ·
Maintainers usually reply within 1 day
All issues in webmachinelearning/webmcp
Similar issues
-
alerts bug effort:S P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nightscout/nocturne#2511 ·
Maintainers usually reply within 1 day
-
Python Volcengine provider returns failures instead of raising themPossibly taken @Ricardo-M-L claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
agent-infra/sandbox#248 ·
-
Textractor leaves empty temporary files when remote retrieval failsPossibly taken @HuaTNA claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PecanProject/pecan#4183 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100