Skip to main content
Glama

get_prompt

Retrieve prompt templates by ID to access parameters and examples for automation tasks.

Instructions

Get a prompt template by ID with its parameters and examples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesPrompt template ID

Implementation Reference

  • The execution handler for the MCP 'get_prompt' tool. Retrieves the prompt by ID from the internal registry and returns structured JSON with prompt details (name, description, category, parameters, examples, tags) or an error response if not found.
    async (args) => {
      const prompt = registry.prompts.get(args.id);
      if (!prompt) {
        return {
          content: [
            {
              type: "text",
              text: `Prompt not found: ${args.id}`,
            },
          ],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                id: prompt.id,
                name: prompt.name,
                description: prompt.description,
                category: prompt.category,
                parameters: prompt.parameters,
                examples: prompt.examples,
                tags: prompt.tags,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Zod schema defining the input for 'get_prompt': a required string 'id' parameter representing the prompt template ID.
    {
      id: z.string().describe("Prompt template ID"),
    },
  • Direct MCP tool registration call using server.tool(), specifying name, description, input schema, and handler function for 'get_prompt'.
    server.tool(
      "get_prompt",
      "Get a prompt template by ID with its parameters and examples",
      {
        id: z.string().describe("Prompt template ID"),
      },
      async (args) => {
        const prompt = registry.prompts.get(args.id);
        if (!prompt) {
          return {
            content: [
              {
                type: "text",
                text: `Prompt not found: ${args.id}`,
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  id: prompt.id,
                  name: prompt.name,
                  description: prompt.description,
                  category: prompt.category,
                  parameters: prompt.parameters,
                  examples: prompt.examples,
                  tags: prompt.tags,
                },
                null,
                2
              ),
            },
          ],
        };
      }
    );
  • src/index.ts:71-71 (registration)
    Top-level registration of the prompts module, which includes the 'get_prompt' tool, called during MCP server setup.
    registerPromptTools(server);
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 states the tool retrieves a prompt template with parameters and examples, which implies a read-only operation, but doesn't specify error handling (e.g., what happens if the ID is invalid), authentication needs, rate limits, or return format. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 purpose ('Get a prompt template by ID') and adds essential details ('with its parameters and examples'). There is no wasted wording, and it directly communicates the tool's function without redundancy.

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 low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage context, behavioral traits, and output. Without annotations or an output schema, more guidance on what 'parameters and examples' entail would improve completeness, but it's not entirely incomplete for a simple retrieval tool.

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, with the single parameter 'id' documented as 'Prompt template ID'. The description adds no additional meaning beyond this, such as format examples or constraints. With high schema coverage, the baseline is 3, as the schema adequately handles parameter semantics without extra description.

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 action ('Get') and resource ('prompt template by ID') with specific attributes ('parameters and examples'). It distinguishes from sibling tools like 'list_prompts' (which lists multiple) and 'validate_prompt' (which validates). However, it doesn't explicitly differentiate from 'render_prompt' (which might render a template), making it slightly less specific than a perfect 5.

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 prerequisites (e.g., needing a valid ID), exclusions, or comparisons to siblings like 'list_prompts' for browsing or 'search_prompts' for finding IDs. Usage is implied by the name but not explicitly stated.

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/ishuru/open-mcp'

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