Skip to content

Expose tools.xml extension tools via MCP tools/list and tools/call #469

Description

@AlbertCorry

Summary

NLWeb's MCP server (POST /mcp) currently exposes only built-in tools (ask, list_sites, who). Extension tools defined in config/tools.xml (e.g. details, compare, ensemble, site-specific tools like cricket_stats and conversation_search) are not discoverable or callable via MCP.

AskAgent/python/webserver/mcp_wrapper.py contains a TODO to integrate router/tools.xml when ready.

Expected behavior

  • tools/list returns built-in MCP tools plus enabled tools.xml extension tools for the selected site
  • tools/call dispatches extension tools to their configured <handler> classes
  • Optional site query parameter selects the <Site id="..."> block in tools.xml
  • Unknown tools return JSON-RPC error -32602; invalid JSON returns -32700
  • Preserve existing ask, list_sites, and who behavior

Context

Tool definitions live in config/tools.xml. Handler dispatch pattern exists in core/baseHandler.py and core/router.py. MCP infrastructure exists in webserver/mcp_wrapper.py and webserver/routes/mcp.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions