Skip to main content
Glama

Get a prompt (optionally a specific version or label)

getPrompt

Retrieve a prompt by name, with optional version or label pinning for precise control.

Instructions

Fetch a prompt by name. Optionally pin to a specific version or label (e.g. 'production').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptNameYes
versionNoSpecific version to fetch (defaults to latest production)
labelNoSpecific label to fetch (e.g. 'production')

Implementation Reference

  • src/tools.ts:168-192 (registration)
    Registration of the 'getPrompt' tool via server.registerTool, including input schema (promptName, version, label) and the async handler.
    server.registerTool(
      "getPrompt",
      {
        title: "Get a prompt (optionally a specific version or label)",
        description:
          "Fetch a prompt by name. Optionally pin to a specific version or label (e.g. 'production').",
        inputSchema: {
          promptName: z.string().min(1),
          version: z
            .number()
            .int()
            .positive()
            .optional()
            .describe("Specific version to fetch (defaults to latest production)"),
          label: z.string().optional().describe("Specific label to fetch (e.g. 'production')"),
        },
      },
      async ({ promptName, version, label }) =>
        asJson(
          await client.get(`/api/public/v2/prompts/${enc(promptName)}`, {
            version,
            label,
          }),
        ),
    );
  • Input schema definition for getPrompt: promptName (required), version (optional positive int), label (optional string).
      inputSchema: {
        promptName: z.string().min(1),
        version: z
          .number()
          .int()
          .positive()
          .optional()
          .describe("Specific version to fetch (defaults to latest production)"),
        label: z.string().optional().describe("Specific label to fetch (e.g. 'production')"),
      },
    },
  • Handler function that calls the Langfuse API endpoint GET /api/public/v2/prompts/{promptName} with optional version/label query parameters.
    async ({ promptName, version, label }) =>
      asJson(
        await client.get(`/api/public/v2/prompts/${enc(promptName)}`, {
          version,
          label,
        }),
      ),
  • src/tools.ts:404-404 (registration)
    The string 'getPrompt' is included in the TOOL_NAMES const array, which lists all registered tool names.
    "getPrompt",
Behavior3/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. It discloses the read-only nature ('Fetch') and the optional version/label pinning. However, it does not mention error behavior (e.g., if prompt not found), return format, or any required permissions, leaving gaps in transparency.

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, well-structured sentence. It is front-loaded with the main verb 'Fetch' and immediately provides the core functionality. No redundant information.

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 is a simple getter with 3 parameters and no output schema or annotations, the description covers the basic operation but does not indicate the output structure, error handling, or any side effects. It meets minimal requirements for a simple fetch but is not comprehensive.

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?

Schema coverage is 67% (version and label have descriptions, promptName lacks one). The description adds context to version/label with the phrase 'optionally pin to a specific version or label (e.g. 'production')', explaining their purpose. However, it does not elaborate further on any parameter, and promptName remains undocumented.

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 'Fetch a prompt by name' with specific verb and resource. It distinguishes from the sibling tool listPrompts, which lists prompts, by focusing on fetching a single prompt. The optional pinning to version/label adds specificity.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives like listPrompts. The description implies usage for retrieving a specific prompt by name, but does not exclude cases where listing might be preferred or provide contextual cues.

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/hugoles/langfuse-mcp'

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