Skip to main content
Glama

pirate_summary

Summarize any text in pirate style using LLM sampling. The output mimics pirate speech with a thematic twist.

Instructions

Summarise the given text in a pirate style. This is an example of a tool that can use LLM sampling to generate a summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the pirate_summary tool. It takes a text string and uses LLM sampling (ctx.sample) to generate a pirate-style summary of the text.
    async def pirate_summary(self, ctx: Context, text: str) -> str | None:
        """Summarise the given text in a pirate style. This is an example of a tool that can use LLM sampling to generate a summary."""
        await ctx.info("Summarising text in pirate style using client LLM sampling.")
        response = await ctx.sample(
            messages=text,
            system_prompt="Your task is to summarise a given text in a pirate style. Use a fun and engaging tone but be concise.",
            temperature=0.9,  # High creativity
            max_tokens=1024,  # Pirates can be a bit verbose!
        )
        return getattr(response, "text", None)
  • Registration metadata for the pirate_summary tool in the PyMCP class's tools list. It maps the function name 'pirate_summary' with tags for discoverability.
    {"fn": "pirate_summary", "tags": ["pirate-summary", "llm-sampling", "example"]},
  • The register_features method in the MCPMixin class iterates over the tools list and registers each tool (by looking up the function name via getattr) with the FastMCP instance. This is how pirate_summary gets registered as an MCP tool.
    def register_features(self, mcp: FastMCP) -> FastMCP:
        """Register tools, resources, and prompts with the given FastMCP instance.
    
        Args:
            mcp (FastMCP): The FastMCP instance to register features with.
    
        Returns:
            FastMCP: The FastMCP instance with registered features.
        """
        # Register tools
        for tool in self.tools:
            assert "fn" in tool, "Tool metadata must include the 'fn' key."
            tool_copy = copy.deepcopy(tool)
            fn_name = tool_copy.pop("fn")
            fn = getattr(self, fn_name)
            mcp.tool(**tool_copy)(fn)  # pass remaining metadata as kwargs
Behavior3/5

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

With no annotations, the description carries full burden. It mentions 'LLM sampling', implying a generative process with potential latency/cost, but does not disclose whether the tool is read-only, idempotent, or has any side effects. Some transparency but incomplete.

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 concise sentences that front-load the purpose and add contextual note about LLM sampling. No wasted words.

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?

For a simple single-parameter tool with an output schema, the description covers the essential behavior. It could mention output format briefly, but the existence of output schema mitigates this.

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 schema has 0% coverage for the 'text' parameter. The description adds meaning by identifying 'the given text' as the input, but does not elaborate on format, constraints, or expected length. Moderate compensation for low schema coverage.

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 verb 'Summarise' and the resource 'the given text in a pirate style', and it distinguishes from siblings which are unrelated tools like password generation or code execution.

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?

No guidance is provided on when to use this tool versus alternatives, such as other summarization tools or the sibling tools. The description does not mention prerequisites or exclusion criteria.

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/anirbanbasu/pymcp'

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