Expose a single, descriptive hf_ask MCP tool

#1
by evalstate HF Staff - opened

Summary

  • Stop publishing list_sites as an MCP tool, leaving a single search tool.
  • Rename the MCP search tool from the generic ask to hf_ask, so it is unambiguous when composed with other MCP servers.
  • Replace the generic description with precise catalog scope, returned information, and mode behavior; update the server instructions and README accordingly.

New tool description

Search a selected, indexed catalog of Hugging Face model repositories using natural-language questions about capabilities, domains, training data, and evaluation evidence. Returns matching model links and relevance explanations. Summarizes results by default; use mode=list for ranked matches or mode=generate for a synthesized answer. Searches this catalog, not the entire live Hugging Face Hub.

Compatibility

This intentionally changes the MCP surface: existing MCP clients should call hf_ask instead of ask; list_sites is no longer registered. The /ask HTTP endpoint, search parameters/defaults, ranking pipeline, result structure, authentication, and transport settings are unchanged. The MCP endpoint is documented with its required trailing slash (/mcp/).

Validation

Added offline regression tests covering the published tool list and input schema, removal of the old tool names, and preservation of search arguments, defaults, and both text/structured responses. The tests mock the search pipeline and make no inference or Hub API calls.

  • python -m pytest -q: 5 passed, tested with MCP 1.27.0 (declared minimum) and 1.30.0, Python 3.12.
  • ruff check src/askhub/mcp_api.py tests/test_mcp_api.py: passed.
  • ruff format --check src/askhub/mcp_api.py tests/test_mcp_api.py: passed.

I think there is value to calling it just /ask (or at least, having an endpoint called /ask). Chatbots seem to be familiar with it.

I do agree there is value in specifying the domain, outside of the description. Perhaps we can add another field for that ...

Agree with the rest.

evalstate changed pull request title from Expose a single, descriptive hf_nl_search MCP tool to Expose a single, descriptive hf_ask MCP tool

Updated this PR to name the MCP tool hf_ask. This retains the familiar “ask” terminology while identifying its Hugging Face domain. The existing /ask HTTP endpoint remains unchanged; only the MCP tool name changes.

rvguha changed pull request status to merged

Sign up or log in to comment