Skip to main content
Glama
fasterv410

logflare-mcp

by fasterv410

Fetch a single source

get_source

Retrieve a Logflare log source by its token to view its details and configuration.

Instructions

Get a single source by its token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_tokenYesSource token (UUID).

Implementation Reference

  • src/index.ts:56-72 (registration)
    Registration of the 'get_source' tool with the MCP server, including its input schema and top-level handler that delegates to LogflareClient.getSource()
    server.registerTool(
    	'get_source',
    	{
    		title: 'Fetch a single source',
    		description: 'Get a single source by its token.',
    		inputSchema: {
    			source_token: z.string().describe('Source token (UUID).'),
    		},
    	},
    	async ({ source_token }) => {
    		try {
    			return text(await client.getSource(client.resolveSourceToken(source_token)))
    		} catch (err) {
    			return errorText(err)
    		}
    	},
    )
  • Input schema for 'get_source' tool: expects a single 'source_token' string parameter (a UUID)
    inputSchema: {
    	source_token: z.string().describe('Source token (UUID).'),
    },
  • Core handler method in LogflareClient that makes a GET request to /api/sources/{token} to fetch a single source
    getSource(token: string) {
    	return this.request<{ data: unknown }>(`/api/sources/${encodeURIComponent(token)}`)
    }
  • Helper method that resolves a source token, falling back to LOGFLARE_DEFAULT_SOURCE_TOKEN environment variable if the argument is undefined
    resolveSourceToken(token: string | undefined): string {
    	const resolved = token || this.cfg.defaultSourceToken
    	if (!resolved) {
    		throw new Error(
    			'source_token is required (pass it to the tool, or set LOGFLARE_DEFAULT_SOURCE_TOKEN).',
    		)
    	}
    	return resolved
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states the action without mentioning side effects, idempotency, authorization needs, or error handling.

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?

The description is a single sentence with no redundancy, efficiently conveying the core purpose. It is front-loaded and easy to parse.

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?

For a simple tool with no annotations and no output schema, the description is adequate but sparse. It lacks context about the meaning of a 'source', the return value, or any usage constraints.

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

Parameters3/5

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

Input schema coverage is 100%, so the schema already describes the parameter. The description adds minimal value beyond the schema, only restating that the token is a UUID.

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 the verb 'Get', the resource 'a single source', and the method 'by its token'. It effectively distinguishes from sibling tools like 'list_sources' which handles multiple sources.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool, when not to use it, or how it differs from alternatives such as 'list_sources' or 'execute_query'.

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/fasterv410/logflare-mcp'

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