Run a saved endpoint
query_endpointExecute a Logflare endpoint by providing its UUID or name and passing query parameters as key/value pairs.
Instructions
Execute a Logflare endpoint by UUID or name. Pass endpoint parameters as a flat key/value object.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token_or_name | Yes | Endpoint UUID or name. | |
| params | No | Query parameters forwarded to the endpoint. |
Implementation Reference
- src/index.ts:147-153 (handler)The tool handler function that receives token_or_name and optional params, then delegates to client.queryEndpoint().
async ({ token_or_name, params }) => { try { return text(await client.queryEndpoint(token_or_name, params ?? {})) } catch (err) { return errorText(err) } }, - src/index.ts:139-145 (schema)Input schema for the query_endpoint tool: token_or_name (string) and optional params (record of string/number values).
inputSchema: { token_or_name: z.string().describe('Endpoint UUID or name.'), params: z .record(z.string(), z.union([z.string(), z.number()])) .optional() .describe('Query parameters forwarded to the endpoint.'), }, - src/index.ts:133-154 (registration)Registration of the 'query_endpoint' tool with the MCP server, including its title, description, input schema, and handler.
server.registerTool( 'query_endpoint', { title: 'Run a saved endpoint', description: 'Execute a Logflare endpoint by UUID or name. Pass endpoint parameters as a flat key/value object.', inputSchema: { token_or_name: z.string().describe('Endpoint UUID or name.'), params: z .record(z.string(), z.union([z.string(), z.number()])) .optional() .describe('Query parameters forwarded to the endpoint.'), }, }, async ({ token_or_name, params }) => { try { return text(await client.queryEndpoint(token_or_name, params ?? {})) } catch (err) { return errorText(err) } }, ) - src/logflare.ts:100-105 (helper)The LogflareClient.queryEndpoint method that makes an HTTP GET request to /api/endpoints/query/{tokenOrName} with the provided query parameters.
queryEndpoint(tokenOrName: string, params: Record<string, string | number | undefined>) { return this.request<unknown>( `/api/endpoints/query/${encodeURIComponent(tokenOrName)}`, { query: params }, ) }