Skip to content

fix: render MCP tool names when a manifest's tools is a string array - #4

Merged
mayank-d3 merged 4 commits into
agent-root:mainfrom
mayank-d3:fix/mcp-record-tools-display
Jul 1, 2026
Merged

mayank-d3 merged 4 commits into
agent-root:mainfrom
mayank-d3:fix/mcp-record-tools-display

Conversation

@mayank-d3

Copy link
Copy Markdown
Collaborator

Summary

MCP record tool names rendered as tools: , , , in resolve and install when a manifest publishes tools as a string array (e.g. czarcash.com → ["search", "get_info", "list_pages", "get_page"]). format-record.ts and install.ts cast tools to Array<{ name }> and read .name, which is undefined for strings. Fixed with one shared, tolerant normalizeTools helper. Drafted with help from Claude; I reviewed every line.

Changes

  • New src/utils/normalize-tools.ts — normalizeTools(unknown): { name, description? }[] tolerating string[] | {name, description}[] | mixed | malformed; non-array → []. unknown + type guards (no any).
  • src/utils/format-record.ts (the resolve display) and src/commands/install.ts (the "Tools:" list) route tools through normalizeTools instead of casting.
  • Tests: new tests/utils/normalize-tools.test.ts (all input shapes) + a string-tools regression in tests/utils/format-record.test.ts.
  • CHANGELOG.md ## [Unreleased] → ### Fixed.

Checklist

  • Conventional Commit message format (feat: / fix: / docs:)
  • Added tests under tests/ that fail without this change (the string-tools regression fails on the old cast)
  • pnpm test passes locally (441 passed)
  • Updated CHANGELOG.md under ## [Unreleased]
  • README unchanged — no new command/flag/surface (display-only fix)
  • Commits signed off with DCO (git commit -s)
  • Manually verified — see below

How to test

pnpm test                 # 441 passed
pnpm build
node dist/bin/agentroot.js resolve czarcash.com --no-install
# Before: tools:    , , ,
# After:  tools:    search, get_info, list_pages, get_page

(docs/screenshots/resolve.png uses doma.xyz, which has no string-tools MCP record, so it's unchanged.)

Related

Closes #3

mayank-d3 added 4 commits July 1, 2026 16:35
Signed-off-by: mayank-d3 <mayank.rawat@d3.com>
Signed-off-by: mayank-d3 <mayank.rawat@d3.com>
Signed-off-by: mayank-d3 <mayank.rawat@d3.com>
Signed-off-by: mayank-d3 <mayank.rawat@d3.com>
@mayank-d3
mayank-d3 force-pushed the fix/mcp-record-tools-display branch from c6b5c0d to 67402bf Compare July 1, 2026 08:42
@mayank-d3
mayank-d3 merged commit 91653e3 into agent-root:main Jul 1, 2026
4 checks passed
@mayank-d3
mayank-d3 deleted the fix/mcp-record-tools-display branch July 1, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] MCP record tool names render empty in resolve/install when tools is a string array

1 participant