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
-
[2.x] extension-manager: update checks fail for composer repositories with credentials in the URLOpentype/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mcnaveen/health-connect-webhook#109 ·
Maintainers usually reply within 1 day
-
[Bug] DefaultSerializationExceptionWrapper does not implement Cleanable, so cleanup() is never invoked by codecsPossibly taken @binbin0325 claimed this today. Opencomponent/need-triage type/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
developmentseed/titiler-cmr#261 ·
Maintainers usually reply within 1 day
-
[Bug]: APIGW request ID headers are inconsistent between server and clientPossibly taken @zouxingyuks claimed this today. Openproduct/backlog
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
TencentBlueKing/bk-nodemgr#3782 ·
Maintainers usually reply within 1 day