Skip to main content
Glama
simplifyaimm

MCP Demo - Document Search Server

by simplifyaimm

get_document

Get the full text of a document by supplying its filename. If the exact filename is unknown, call list_documents first.

Instructions

Retrieve the full text of a document by filename. Call list_documents first if you're unsure of the exact filename.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'get_document'. It is decorated with @mcp.tool() and delegates to _index.get_document(filename).
    @mcp.tool()
    def get_document(filename: str) -> str:
        """
        Retrieve the full text of a document by filename.
        Call list_documents first if you're unsure of the exact filename.
        """
        return _index.get_document(filename)
  • server/main.py:59-59 (registration)
    The @mcp.tool() decorator on the get_document function registers it as an MCP tool with the FastMCP server instance.
    @mcp.tool()
  • The DocumentIndex.get_document() method that retrieves the full text of a document by filename from the in-memory index, or returns an error message if not found.
    def get_document(self, filename: str) -> str:
        if filename not in self.documents:
            available = ", ".join(sorted(self.documents)) or "none"
            return f"Document '{filename}' not found. Available: {available}"
        return self.documents[filename]
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It mentions 'full text' but does not disclose behavior like error handling, size limits, or authentication requirements. It is adequate for a simple tool but lacks depth.

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?

Two sentences: first states purpose, second provides usage hint. No wasted words, perfectly front-loaded.

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

Completeness4/5

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

The tool is simple with one parameter and an output schema (not shown). The description covers the core action and pre-requisite step, but omits details like error handling or file-not-found behavior. Still, it is fairly complete for the simplicity.

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 only parameter 'filename' has no schema description (0% coverage). The description adds 'by filename' but does not explain format, case sensitivity, or path requirements. For a simple retrieval, it is minimally sufficient.

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

Purpose5/5

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

The description clearly states the action ('Retrieve the full text of a document') and the resource ('by filename'), distinguishing it from siblings 'list_documents' (listing files) and 'search_documents' (searching).

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

Usage Guidelines5/5

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

Provides explicit guidance: 'Call list_documents first if you're unsure of the exact filename,' telling the agent when to use an alternative tool.

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/simplifyaimm/mcp-demo'

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