modelcontextprotocol / modelcontextprotocol/ext-apps
ontoolinput is not consistently called
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 387
- Avg merge
- 3h 21m
- Merged PRs (30d)
- 6
Description
Describe the bug
Using the useApp hook, I notice app.ontoolinput is not consistently called although it is registered before app.connect
To Reproduce
Steps to reproduce the behavior:
- Instantiate
useApp()with a minimal setup:
import { useApp } from "@modelcontextprotocol/ext-apps/react";
//...
useApp({
appInfo: { name: "Describe your app here...", version: "1.0.0" },
capabilities: {},
onAppCreated: (app) => {
app.ontoolinput = (input) => {
console.info("Received tool call input:", input);
};
},
});
- Run the app in any host
- Call a tool with user input using a manual prompt
- Notice how
app.ontoolinputis not always called
Expected behavior
app.ontoolinput is called every time a tool is invoked
Logs
If applicable, add logs to help explain your problem.
Additional context
Other callbacks seem to run as expected, including app.ontoolresult.
Contributor guide
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.
Research direction
Start at the useApp hook imported from @modelcontextprotocol/ext-apps/react and trace how app.ontoolinput is registered relative to app.connect. Reproduce the manual-prompt tool call in a minimal app and compare it with the working ontoolresult callback. Done means ontoolinput is called for every tool invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100