Repository navigation
feat(mcp): add titles, inspector tags and structured output to agent tools - #411
Merged
Merged
Conversation
…tools
MCP clients showed raw ids such as pangular:list-pages in their tool lists
and approval prompts, and had to parse the text to read an answer.
Give every built-in agent tool a short title, sent as the MCP title and
annotations.title. Tag each tool with its inspector key from
AGENT_INSPECTOR in the registration wrappers, so devframe's agent manifest
can group them (devframe 1.2.5 does not send tags over MCP). Give the
list-* and inspect-* tools and the Analog list tools an object
outputSchema for their { markdown } answer, so devframe also sends it as
structuredContent. The text content stays exactly as before. Source scan
tools that return arrays and screenshot-component keep no output schema.
… none Called without selector while a page reports, both tools threw a TypeError that reached the agent as a raw tool error. They now answer with what to pass.
Contributor
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
|
View your CI Pipeline Execution ↗ for commit 5e07f3a
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The "tool titles / tags / structuredContent" item from #372.
Titles. Every built-in agent tool (89) has a short title, inline on its
registerToolcall: sentence case, 40 characters or fewer, unique, no "Pangular" (for example List connected pages, Inspect a component). devframe sends it as the MCPtitleandannotations.title, and browser tools (WebMCP) pass it through too. The RPC-backedget-*andbuild-metatools already had titles. Plugin tools keep the titles their plugins give them.Tags. Every tool is tagged with its inspector key through devframe's
tagsfield, using the same keys asAGENT_INSPECTOR(newagentTags(id)inconfig.ts).clear-recordingsgetshttp,routerandanalog; plugin tools getplugins; shared tools (list-pages,open-in-panel,audit,build-meta) get none. devframe 1.2.5 keeps tags in its agent manifest but does not send them over MCPtools/list, so MCP clients don't see them yet. No wire format of our own is added, and the docs don't mention tags.Structured output. The
registerTooltools answer with a{ markdown }object, which devframe sends as JSON text. 29 of them now declareMARKDOWN_OUTPUT_SCHEMA(a valibot schema converted with@valibot/to-json-schema,type: object), so devframe also sends the same object asstructuredContent. The text content does not change. Withbuild-meta, which already had one, 30 tools sendstructuredContent:list-*tool;inspect-*tool;analog-routes,analog-api-routes,analog-server-functions,analog-server-calls,analog-content.Left out on purpose:
get-routes,get-components,get-pipes,get-signals,get-providersandget-ngrx-storereturn JSON arrays. Wrapping them in an object would change the text (the devframe feat: add fetch SSR tracing, a waterfall, store history and a TanStack Query inspector #400 pitfall).screenshot-componentanswers with image blocks and nostructuredContent, so a schema would make clients reject it.Fix found along the way. Calling
inspect-componentorhighlightwithoutselectorwhile a page reported threw aTypeError, which reached the agent as a raw tool error. Both now answer with what to pass.Docs: a "Titles and structured output" section in the MCP server page, with the table of tools that send
structuredContent, and a link to it from the agent tools page. Tool counts are unchanged.Refs #372.
How it was verified
pnpm commit:checkpnpm format:checkpnpm typecheckpnpm test:devtools(3111) andpnpm test:panel. Newtool-metadata.test.ts(9 tests):titleandannotations.title;structuredContentvalidates and equals the parsed text;list-pages,list-componentsandget-routesis byte-for-byte unchanged;selectorgets a clear answer.pnpm skills:checkapps/docsupdated andpnpm docs:buildpassespnpm extension:build(noapp/change)@modelcontextprotocol/clientagainst the hub listed 95 tools, all titled, 30 with an output schema, and validated 179 tool calls.Summary by CodeRabbit