get_projects
Retrieve available Langfuse projects to analyze analytics, cost metrics, and usage data across your AI applications.
Instructions
List available Langfuse projects (alias for list_projects).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/get-projects.ts:7-18 (handler)The primary handler function for the 'get_projects' tool. It retrieves the current project ID using the client and formats it as a JSON response containing a list of projects. This is an alias implementation for list_projects.export async function getProjects(client: LangfuseAnalyticsClient) { const projectId = client.getProjectId(); return { content: [ { type: 'text' as const, text: JSON.stringify({ projects: [projectId] }, null, 2), }, ], }; }
- src/tools/get-projects.ts:5-5 (schema)Zod schema for validating input arguments to the get_projects tool. Defines an empty object schema as the tool takes no parameters.export const getProjectsSchema = z.object({});
- src/index.ts:290-297 (registration)Registration of the 'get_projects' tool in the allTools array used by the ListToolsRequestSchema handler. This defines the tool's metadata exposed to MCP clients.{ name: 'get_projects', description: 'List available Langfuse projects (alias for list_projects).', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:1031-1034 (registration)Tool dispatcher case in the CallToolRequestSchema handler's switch statement. Parses arguments using the schema and delegates execution to the getProjects handler function.case 'get_projects': { const args = getProjectsSchema.parse(request.params.arguments); return await getProjects(this.client); }
- src/mode-config.ts:35-35 (helper)Inclusion of 'get_projects' in the readOnlyTools Set, allowing it in readonly mode configurations.'get_projects',