Skip to main content
Glama
therealsachin

Langfuse MCP Server

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

TableJSON Schema
NameRequiredDescriptionDefault
promptNameYesThe prompt name to retrieve
versionNoSpecific version to retrieve (if not provided, gets latest)
labelNoSpecific label to retrieve

Implementation Reference

  • 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,
        };
      }
    }
  • 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';

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

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