Skip to main content
Glama

show_example

Demonstrate practical examples of MCP features like 'tool_call' or 'resource_read' to help developers understand and implement MCP concepts effectively.

Instructions

Show a practical example of an MCP feature

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureYesThe MCP feature to demonstrate (e.g., 'tool_call', 'resource_read', 'prompt_template')

Implementation Reference

  • Handler function that executes the 'show_example' tool by returning a predefined code example based on the input feature.
      if (name === "show_example" && args) {
        const feature = (args.feature as string).toLowerCase();
        const examples: Record<string, string> = {
          "tool_call": `Here's an example of defining and using a tool:
    
    // Define the tool
    {
      name: "calculate_sum",
      description: "Add two numbers together",
      inputSchema: {
        type: "object",
        properties: {
          a: { type: "number" },
          b: { type: "number" }
        },
        required: ["a", "b"]
      }
    }
    
    // Use the tool
    const result = await server.callTool("calculate_sum", { a: 5, b: 3 });
    // Result: 8`,
    
          "resource_read": `Here's an example of exposing and reading a resource:
    
    // Define the resource
    {
      uri: "file:///docs/guide.md",
      name: "MCP Guide",
      description: "Documentation for MCP concepts",
      mimeType: "text/markdown"
    }
    
    // Read the resource
    const content = await server.readResource("file:///docs/guide.md");`,
    
          "prompt_template": `Here's an example of a prompt template:
    
    {
      name: "code_review",
      description: "Review code for best practices",
      arguments: [
        {
          name: "language",
          description: "Programming language",
          required: true
        },
        {
          name: "code",
          description: "Code to review",
          required: true
        }
      ]
    }
    
    // Generated prompt:
    "Please review this {language} code:\n{code}"`
        };
    
        const example = examples[feature];
        if (!example) {
          return {
            content: [{
              type: "text",
              text: `I don't have an example for "${feature}" yet. Available examples: ${Object.keys(examples).join(", ")}`
            }]
          };
        }
    
        return {
          content: [{
            type: "text",
            text: example
          }]
        };
      }
  • src/index.ts:272-285 (registration)
    Registration of the 'show_example' tool in the listTools response, including its name, description, and input schema.
    {
      name: "show_example",
      description: "Show a practical example of an MCP feature",
      inputSchema: {
        type: "object",
        properties: {
          feature: {
            type: "string",
            description: "The MCP feature to demonstrate (e.g., 'tool_call', 'resource_read', 'prompt_template')",
          }
        },
        required: ["feature"]
      }
    },
  • Schema definition for the 'show_example' tool, specifying the required 'feature' input parameter.
    {
      name: "show_example",
      description: "Show a practical example of an MCP feature",
      inputSchema: {
        type: "object",
        properties: {
          feature: {
            type: "string",
            description: "The MCP feature to demonstrate (e.g., 'tool_call', 'resource_read', 'prompt_template')",
          }
        },
        required: ["feature"]
      }
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'shows' an example, implying a read-only or display operation, but doesn't clarify aspects like output format, interactivity, or any constraints (e.g., rate limits, authentication needs). This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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, clear sentence that directly states the tool's purpose without unnecessary words or complexity. It is front-loaded and efficiently conveys the essential information, making it easy to parse and understand quickly.

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?

For a tool with one well-documented parameter and no output schema, the description is minimally adequate but lacks depth. It doesn't explain what the output entails (e.g., text, code snippet, interactive demo) or address behavioral traits, which is a gap given the absence of annotations. This makes it functional but incomplete for guiding an agent fully.

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 input schema has 100% description coverage, clearly documenting the 'feature' parameter with examples. The description adds no additional meaning beyond what the schema provides, such as elaborating on feature options or usage context. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately handles parameter semantics without extra description value.

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 ('show') and resource ('practical example of an MCP feature'), making it understandable. However, it doesn't explicitly distinguish itself from sibling tools like 'explain_concept' or 'list_servers', which might also involve demonstrating or explaining MCP features, leaving some ambiguity about its unique role.

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 such as 'explain_concept' or 'list_servers'. It lacks explicit context, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name alone, which is insufficient for optimal selection.

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

Related 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/qpd-v/mcp-guide'

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