Skip to main content
Glama
Rodriguespn

Logflare MCP Code Mode

by Rodriguespn

Read from the Logflare API

execute_read
Read-only

Execute JavaScript functions to read data from the Logflare Management API using only GET requests, ensuring no state changes.

Instructions

Read data from the Logflare Management API by writing JavaScript. Only GET requests are allowed — use execute_write for anything that changes state.

Example: async () => (await api.request({ method: 'GET', path: '/api/sources' })).data

Your code is an async arrow function that returns a value. In scope:

declare const api: { request<T = unknown>(options: { method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; // default GET path: string; // e.g. "/api/sources" — see the search tool query?: Record<string, string | number | boolean | undefined>; body?: unknown; // JSON by default contentType?: string; // overrides the default application/json rawBody?: boolean; // send body as-is (no JSON.stringify) }): Promise<{ status: number; ok: boolean; data: T }>; };

Returns a JSON object — result (or error), calledEndpoints, and stdout/stderr — wrapped in an untrusted-data envelope. Use the search tool first to find paths. Access-token, backend, and team endpoints (/api/access-tokens, /api/backends, /api/teams) are blocked — they mint/reveal access tokens, backend connection config, or the account's master API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAsync arrow function using `api`; must return a value.
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds that only GET requests are allowed, that certain endpoints (access-tokens, backends, teams) are blocked, and describes the return structure (untrusted-data envelope). No contradiction with annotations.

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

Conciseness4/5

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

The description is fairly long but well-structured: a concise purpose sentence, then example, then details. Every sentence adds value, though it could be slightly more trimmed. Still, it avoids redundancy and is organized.

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

Completeness5/5

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

Despite no output schema, the description explains the return format (result, calledEndpoints, stdout/stderr in untrusted-data envelope), mentions blocked endpoints, and provides sufficient context for a read tool. No major gaps.

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

Parameters5/5

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

Input schema has one parameter 'code' with minimal description. The description adds significant meaning: an example async function, the full type signature of the `api` object, and details on return values. This greatly enriches the agent's understanding of how to write the code.

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 clearly states 'Read data from the Logflare Management API by writing JavaScript' and specifies 'Only GET requests are allowed', providing a specific verb, resource, and method restriction. It distinguishes from sibling execute_write by noting that execute_write should be used for state changes.

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

Usage Guidelines5/5

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

The description explicitly says 'use execute_write for anything that changes state' and advises 'Use the search tool first to find paths'. This gives clear when-to-use and when-not-to-use guidance, along with alternatives.

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/Rodriguespn/logflare-mcp-code-mode'

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