get_prompt_detail
Retrieve detailed information about a specific prompt template, including version history and labeling data, from Langfuse analytics.
Instructions
Get detailed information about a specific prompt template.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| promptName | Yes | The prompt name to retrieve | |
| version | No | Specific version to retrieve (if not provided, gets latest) | |
| label | No | Specific label to retrieve |
Input Schema (JSON Schema)
{
"properties": {
"label": {
"description": "Specific label to retrieve",
"type": "string"
},
"promptName": {
"description": "The prompt name to retrieve",
"type": "string"
},
"version": {
"description": "Specific version to retrieve (if not provided, gets latest)",
"type": "number"
}
},
"required": [
"promptName"
],
"type": "object"
}
Implementation Reference
- src/tools/get-prompt-detail.ts:12-39 (handler)The async handler function that executes the tool logic: fetches prompt data from Langfuse client and returns formatted JSON or error.export async function getPromptDetail( client: LangfuseAnalyticsClient, args: GetPromptDetailArgs ) { try { const promptData = await client.getPrompt(args.promptName, args.version, args.label); return { content: [ { type: 'text' as const, text: JSON.stringify(promptData, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text' as const, text: `Error getting prompt detail: ${errorMessage}`, }, ], isError: true, }; } }
- src/tools/get-prompt-detail.ts:4-8 (schema)Zod schema for input validation of get_prompt_detail tool arguments.export const getPromptDetailSchema = z.object({ promptName: z.string().describe('The prompt name to retrieve'), version: z.number().optional().describe('Specific version to retrieve (if not provided, gets latest)'), label: z.string().optional().describe('Specific label to retrieve'), });
- src/index.ts:600-621 (registration)Tool descriptor registration in the listToolsRequestHandler, specifying name, description, and inputSchema.{ name: 'get_prompt_detail', description: 'Get detailed information about a specific prompt template.', inputSchema: { type: 'object', properties: { promptName: { type: 'string', description: 'The prompt name to retrieve', }, version: { type: 'number', description: 'Specific version to retrieve (if not provided, gets latest)', }, label: { type: 'string', description: 'Specific label to retrieve', }, }, required: ['promptName'], }, },
- src/index.ts:1087-1090 (registration)Dispatch case in the CallToolRequestHandler switch statement that validates args with schema and invokes the handler.case 'get_prompt_detail': { const args = getPromptDetailSchema.parse(request.params.arguments); return await getPromptDetail(this.client, args); }
- src/index.ts:71-71 (registration)Import statement bringing in the handler function and schema from the tool module.import { getPromptDetail, getPromptDetailSchema } from './tools/get-prompt-detail.js';