Skip to main content
Glama
jcdumlao14

FastMCP Documentation & Web Scraping Server

by jcdumlao14

search_docs

Search indexed documentation files to find relevant information by querying the FastMCP documentation index and returning top matching filenames.

Instructions

Search the documentation index and return top filenames for query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:94-98 (handler)
    The handler function for the 'search_docs' tool. It is registered with the @mcp.tool decorator, calls the core implementation, and returns a list of top filenames matching the query.
    @mcp.tool
    def search_docs(query: str) -> list:
        """Search the documentation index and return top filenames for `query`."""
        results = search_docs_impl(query, top_k=5)
        return [r.get('filename') for r in results]
  • main.py:88-92 (helper)
    Core implementation of the search logic. Retrieves the pre-built index and performs similarity search using minsearch, returning the top results.
    def search_docs_impl(query: str, top_k: int = 5):
        idx = get_index()
        results = idx.search(query, num_results=top_k)
        return results
  • main.py:81-86 (helper)
    Lazy-loading helper for the documentation index. Builds it on first use if not cached and returns the index instance.
    def get_index():
        global _INDEX_CACHE
        if _INDEX_CACHE is None:
            _INDEX_CACHE = build_index_from_zip()
        return _INDEX_CACHE
  • main.py:69-79 (helper)
    Builds the minsearch index by downloading the FastMCP repo zip (if needed), extracting .md/.mdx files, and indexing their content and filenames.
    def build_index_from_zip():
        docs = []
        ensure_zip()
        for fname in os.listdir('.'):
            if fname.lower().endswith('.zip'):
                for filename, text in iter_md_files_from_zip(fname):
                    docs.append({'content': text, 'filename': filename})
        idx = Index(text_fields=["content"], keyword_fields=["filename"])
        idx.fit(docs)
        return idx
  • main.py:44-53 (helper)
    Downloads the FastMCP GitHub repo zip archive if it doesn't exist locally.
    def ensure_zip():
        if os.path.exists(ZIP_NAME):
            return
        resp = requests.get(ZIP_URL, stream=True, timeout=60)
        resp.raise_for_status()
        with open(ZIP_NAME, "wb") as f:
            for chunk in resp.iter_content(1024 * 64):
                if chunk:
                    f.write(chunk)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the action ('Search') and return type ('top filenames'), but lacks details on permissions, rate limits, pagination, or error handling. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and result. Every word earns its place, with no redundancy or unnecessary details, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search operation), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose but lacks behavioral context and parameter details. The output schema likely handles return values, but the description doesn't provide enough guidance for effective use without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal semantics beyond the input schema. It clarifies that the 'query' parameter is used for searching, but with 0% schema description coverage and only one parameter, the baseline is 4. However, it doesn't explain query syntax, format, or examples, so it doesn't fully compensate for the lack of schema documentation, resulting in a score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Search') and resource ('documentation index'), and specifies what it returns ('top filenames for query'). It distinguishes itself from sibling tools like 'add' and 'fetch_markdown' by focusing on search functionality. However, it doesn't explicitly differentiate from potential similar search tools beyond the scope of this server.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, exclusions, or comparisons with sibling tools like 'add' or 'fetch_markdown'. The usage context is implied (searching documentation), but no explicit guidelines are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcdumlao14/03-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server