Skip to main content
Glama

Check Langfuse API health

getHealth

Ping the Langfuse health endpoint to validate credentials and connectivity.

Instructions

Pings the Langfuse public health endpoint. Useful to validate credentials and connectivity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for getHealth – pings the Langfuse public health endpoint via client.get('/api/public/health')
      async () => asJson(await client.get("/api/public/health")),
    );
  • Input schema for getHealth – empty object (no parameters required)
    inputSchema: {},
  • src/tools.ts:380-389 (registration)
    Tool registration of getHealth via server.registerTool() with title, description, inputSchema, and handler
    server.registerTool(
      "getHealth",
      {
        title: "Check Langfuse API health",
        description:
          "Pings the Langfuse public health endpoint. Useful to validate credentials and connectivity.",
        inputSchema: {},
      },
      async () => asJson(await client.get("/api/public/health")),
    );
  • The asJson helper used by the handler to wrap the API response in MCP content format
    const asJson = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
  • The LangfuseClient.get() method that executes the actual HTTP GET request to /api/public/health
    async get(path: string, params: QueryParams = {}): Promise<unknown> {
      const url = new URL(`${this.baseUrl}${path}`);
    
      for (const [key, value] of Object.entries(params)) {
        if (value === undefined || value === null || value === "") continue;
        if (Array.isArray(value)) {
          for (const item of value) url.searchParams.append(key, String(item));
        } else {
          url.searchParams.set(key, String(value));
        }
      }
    
      const response = await fetch(url, {
        headers: {
          Authorization: this.authHeader,
          Accept: "application/json",
        },
      });
    
      const text = await response.text();
    
      if (!response.ok) {
        throw new LangfuseError(
          `Langfuse API ${response.status} ${response.statusText}: ${text.slice(0, 500)}`,
          response.status,
          text,
        );
      }
    
      try {
        return JSON.parse(text) as unknown;
      } catch {
        throw new LangfuseError(
          `Langfuse API returned non-JSON response from ${url.pathname}: ${text.slice(0, 200)}`,
          response.status,
          text,
        );
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. 'Pings' implies a non-destructive, lightweight call, but details about failure behavior, rate limits, or authentication requirements are missing. For a simple health endpoint, this is marginally adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences that are front-loaded with the action and purpose, with no extraneous information. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description does not explain the return value format. For a health endpoint, a brief note on the response (e.g., status string) would improve completeness. It is functional but minimal.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters, so per guidelines the baseline is 4. The description adds no parameter information, but none is needed as the input schema is empty.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Pings') and resource ('Langfuse public health endpoint'), and explains the purpose ('validate credentials and connectivity'). This clearly distinguishes it from sibling tools that operate on specific entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states when to use the tool ('validate credentials and connectivity'). While it doesn't explicitly state when not to use it or provide alternatives, the context of it being a health check is clear among many data-retrieval siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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