list_projects
Retrieve available Langfuse projects to analyze analytics, costs, and usage data across multiple configurations.
Instructions
List configured Langfuse projects available to this MCP server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/list-projects.ts:6-17 (handler)The main handler function for the 'list_projects' tool. It retrieves the current project ID using the client and returns it as a JSON-formatted text content block.export async function listProjects(client: LangfuseAnalyticsClient) { const projectId = client.getProjectId(); return { content: [ { type: 'text' as const, text: JSON.stringify({ projects: [projectId] }, null, 2), }, ], }; }
- src/tools/list-projects.ts:4-4 (schema)Zod validation schema for the 'list_projects' tool input parameters. This tool takes no arguments.export const listProjectsSchema = z.object({});
- src/index.ts:150-157 (registration)Registration of the 'list_projects' tool in the allTools array, which is used to respond to ListToolsRequest. Defines name, description, and input schema.{ name: 'list_projects', description: 'List configured Langfuse projects available to this MCP server.', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:1000-1003 (registration)Dispatch logic in the CallToolRequest handler that validates input using listProjectsSchema and invokes the listProjects handler function.case 'list_projects': { const args = listProjectsSchema.parse(request.params.arguments); return await listProjects(this.client); }
- src/index.ts:52-52 (registration)Import statement that brings the handler and schema into the main index file for use in tool dispatching.import { listProjects, listProjectsSchema } from './tools/list-projects.js';