Get a prompt (optionally a specific version or label)
getPromptRetrieve 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
| Name | Required | Description | Default |
|---|---|---|---|
| promptName | Yes | ||
| version | No | Specific version to fetch (defaults to latest production) | |
| label | No | Specific 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, }), ), ); - src/tools.ts:174-184 (schema)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')"), }, }, - src/tools.ts:185-191 (handler)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",