$ lexprog.com

// notes from an old coder -- php, databases, and the occasional rant

[October 11, 2026] AI

List MCP Tools Before You Trust the Prompt

After connecting, list tools and confirm names, descriptions, and schemas. A renamed tool silently breaks old prompts that hardcode the name.

────────────────────────────────────────────────────────

List MCP Tools Before You Trust the Prompt

Tip: The model only sees what the client advertises

After connecting, list tools and confirm names, descriptions, and schemas. A renamed tool silently breaks old prompts that hardcode the name.

tools = await session.list_tools()
for tool in tools.tools:
    print(tool.name, tool.description)

Gotcha: Stale tool names look like model failure

If search_docs became docs.search, the model will keep calling the old name. Refresh the catalog on session start.

assert "search_docs" in {t.name for t in tools.tools}

Source: https://modelcontextprotocol.io/docs/concepts/tools

────────────────────────────────────────────────────────
<-- back to posts