Repository navigation
mcp: fix and improve agent tool design from the October 2026 audit #331
Copy link
Copy link
Closed as duplicate
Labels
bugSomething is broken or shows wrong dataSomething is broken or shows wrong datafeatureA feature request or a pull request that adds oneA feature request or a pull request that adds one
Description
Context
This comes from a code audit of the MCP agent tools (devframe.ts, rpc/*.ts, config.ts) done during a comparison with other devtools in October 2026. Roadmap items live in #310, #311, #312 and #313. Items marked (to confirm) were not reproduced.
Problems
Low
- No tool titles or structured output: no
agent.registerToolcall indevframe.tssetstitle, so MCP clients show raw ids such aspangular:list-http-callsfor most tools; only the RPC-backed tools (for exampleget-components.ts:44,build-meta.ts:28) have one. No tool setstagsoroutputSchema, and every live tool returns markdown only. Add a shorttitleand per-inspectortagsto each tool, and returnstructuredContentnext to the markdown for the list tools (list-pages,list-http-calls,list-components) so agents get stable ids without parsing text (packages/devtools/src/devframe.ts:909,1743,2281). - Undeclared
pageon form tools:form-actionandfill-formcallunknownFormPage(args), which readspage, but neitherinputSchemadeclares it, so clients never send it and the check is dead. Addpage: PAGE_ARGUMENTto both schemas or remove the check (packages/devtools/src/devframe.ts:2798,2851,2425). - Inconsistent page argument:
highlight,inspect-component,defer-blocksandinspect-providersstill accept apageIdalias next topage, while the others take onlypage. UsePAGE_ARGUMENTeverywhere and drop thepageIdaliases in a minor release (packages/devtools/src/devframe.ts:1761,1825,1914,2100). - Uncapped raw resources: the
component-tree,signal-graph,injector-treeandngrx-storeresources returnJSON.stringify(state, null, 2)of every page, with no size cap and no untrusted-data notice, although the strings come from the page. Cap the size, drop the indentation and add theUNTRUSTEDnotice (or an_untrustedfield) (packages/devtools/src/devframe.ts:1616,1625,1634,1643). - Panel-only actions:
clear-http-calls,clear-router-navigations,analog-clear-callsandrequest-component-pickhave no agent tool, so an agent can't reset recorded data between repro runs. Add aclear-recordingstool (http, router, analog) gated by the matchingactions.*, and list it inACTION_TOOLSandAGENT_INSPECTORand inagents/tools.md(packages/devtools/src/devframe.ts:623,833,1355,packages/devtools/src/rpc/analog-register.ts:227). -
analog-call-apipath not described:pathhas no description and nothing says it must be a same-origin path starting with/, so agents guess whether to pass a full URL. Describepath,methodandbody, and spell out theconfirmrule in the schema (packages/devtools/src/rpc/analog-register.ts:351-358).
Improvements
- Generate
AGENT_INSPECTOR,ACTION_TOOLSandPAGE_AGENT_ENTRIESfrom metadata on eachregisterToolcall (inspector, action, needs page) instead of three hand-kept lists, so a new tool can't be left out (packages/devtools/src/config.ts:407,495,548,packages/devtools/src/devframe.ts). - Add MCP prompts for common workflows ("debug an invalid form", "why didn't this route load", "find slow change detection"), each chaining
list-pageswith the inspect and explain tools (packages/devtools/src/devframe.ts). - Turn the six resources into per-page resource templates (
pangular://page/{pageId}/component-tree) and sendresources/list_changedwhen a page connects or expires, so clients can subscribe instead of polling (packages/devtools/src/devframe.ts:1610-1662). - Add a general
wait-fortool (app stable, navigation end, HTTP idle,@defercomplete) that generalizeswait-for-formandnavigate'swaitFor: 'stable'(packages/devtools/src/devframe.ts:2730,2281). - Add a "snapshot everything" export tool (component tree, route, forms, HTTP, NgRx) for bug reports, next to the existing
export-formandexport-navigation(packages/devtools/src/devframe.ts:2241,2714). - Keep tool descriptions under about 600 characters.
inspect-forms,navigateand thengrx-storeresource run past 1,000, which costs context in every client's tool list (packages/devtools/src/devframe.ts:1638,2281,2437). - Add a module and lazy-chunk graph tool through the Vite plugin, as vite-plugin-mcp does (
packages/devtools/src/vite.ts).
Already tracked elsewhere
devframe_state_readanddevframe://stateexpose data of inspectors turned off for agents: mcp: agent.tools.<inspector>=false still exposes the inspector's data through devframe_state_read #238, phase 1 of 4: safe by default, open in editor and cheap shell wins #310.agent.readOnlykeeps tools of adestructivetier: phase 1 of 4: safe by default, open in editor and cheap shell wins #310 (three safety tiers).- Writes such as submit, restore, dispatch and non-GET API calls are not marked
destructive: phase 1 of 4: safe by default, open in editor and cheap shell wins #310. - Inconsistent safety classes (
highlight,record-pipes,change-detection,navigate, emptyACTION_TOOLS.router): phase 1 of 4: safe by default, open in editor and cheap shell wins #310. - Missing errors, console, screenshot and open-in-editor tools: phase 1 of 4: safe by default, open in editor and cheap shell wins #310, phase 3 of 4: a devframe shell as good as Vue and Nuxt DevTools #312, phase 4 of 4: lead where no Angular devtools goes today #313. NgRx restore and SSR override agent tools: phase 4 of 4: lead where no Angular devtools goes today #313.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething is broken or shows wrong dataSomething is broken or shows wrong datafeatureA feature request or a pull request that adds oneA feature request or a pull request that adds one
Activity
feat(mcp): add clear-recordings agent tool
feat(mcp): add clear-recordings agent tool (#365)