Skip to main content
Glama
Rodriguespn

Logflare MCP Code Mode

by Rodriguespn

Write to the Logflare API

execute_write
Destructive

Write JavaScript to send state-changing requests (POST, PUT, PATCH, DELETE) to the Logflare Management API, enabling resource creation and updates.

Instructions

Call the Logflare Management API by writing JavaScript, including state-changing requests (POST/PUT/PATCH/DELETE). Use execute_read for plain reads.

Example: async () => (await api.request({ method: 'POST', path: '/api/sources', body: { name: 'my-source' } })).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 set destructiveHint=true and readOnlyHint=false. Description adds valuable context: the tool performs mutation (POST/PUT/PATCH/DELETE), explains the return envelope, and lists blocked endpoints. No contradictions.

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?

Well-structured with purpose statement, usage guideline, example, and detailed param explanation. Slightly verbose but each section adds value. Could be tightened by removing redundant details like the full api definition in scope.

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?

For a single-parameter tool with no output schema, the description covers input (code format), API usage, return format, and security restrictions. Addresses all key aspects an agent needs to know.

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?

Schema describes the 'code' parameter minimally. Description provides a full example, the api object definition, and details on how to structure requests, adding significant meaning beyond the schema.

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?

Clearly states it calls the Logflare Management API with state-changing requests (POST/PUT/PATCH/DELETE). Distinguishes from sibling execute_read by specifying write vs read.

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?

Explicitly tells when to use this tool ('for state-changing requests') and when to use the alternative ('Use execute_read for plain reads'). Warns about blocked endpoints (access-tokens, backends, teams) to prevent misuse.

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