Skip to main content
Glama
list-models.tsβ€’967 B
import { z } from 'zod'; import { LangfuseAnalyticsClient } from '../langfuse-client.js'; export const listModelsSchema = z.object({ limit: z.number().optional().describe('Maximum number of models to return (default: 50)'), page: z.number().optional().describe('Page number for pagination'), }); export type ListModelsArgs = z.infer<typeof listModelsSchema>; export async function listModels( client: LangfuseAnalyticsClient, args: ListModelsArgs = {} ) { try { const modelsData = await client.listModels(args); return { content: [ { type: 'text' as const, text: JSON.stringify(modelsData, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text' as const, text: `Error listing models: ${errorMessage}`, }, ], isError: true, }; } }

Implementation Reference

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