Skip to main content
Glama
fasterv410

logflare-mcp

by fasterv410

Get recent events from a source

get_recent_events

Fetch recent log events for a source to tail logs and triage incidents in real time.

Instructions

Fetch the most recent log events for a source. Useful for tailing and incident triage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_tokenNoSource token. Falls back to LOGFLARE_DEFAULT_SOURCE_TOKEN if omitted.

Implementation Reference

  • The actual handler/API call for getRecentEvents. Makes a GET request to /api/sources/{token}/recent and returns the JSON response with a data array.
    getRecentEvents(token: string) {
    	return this.request<{ data: unknown[] }>(
    		`/api/sources/${encodeURIComponent(token)}/recent`,
    	)
    }
  • Input schema for get_recent_events: takes an optional source_token string (falls back to LOGFLARE_DEFAULT_SOURCE_TOKEN).
    inputSchema: {
    	source_token: z
    		.string()
    		.optional()
    		.describe('Source token. Falls back to LOGFLARE_DEFAULT_SOURCE_TOKEN if omitted.'),
    },
  • src/index.ts:95-115 (registration)
    Registration of the 'get_recent_events' tool with title, description, input schema, and async handler that calls client.getRecentEvents.
    server.registerTool(
    	'get_recent_events',
    	{
    		title: 'Get recent events from a source',
    		description:
    			'Fetch the most recent log events for a source. Useful for tailing and incident triage.',
    		inputSchema: {
    			source_token: z
    				.string()
    				.optional()
    				.describe('Source token. Falls back to LOGFLARE_DEFAULT_SOURCE_TOKEN if omitted.'),
    		},
    	},
    	async ({ source_token }) => {
    		try {
    			return text(await client.getRecentEvents(client.resolveSourceToken(source_token)))
    		} catch (err) {
    			return errorText(err)
    		}
    	},
    )
Behavior2/5

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

With no annotations, the description only indicates a read operation ('Fetch') but lacks details on return limits, pagination, error handling, or consequences of missing tokens, which an agent needs for safe invocation.

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 efficiently cover purpose and usage context without redundancy, earning every word 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?

While simple, the description omits crucial operational details like number of events returned, ordering, or any output format, leaving an agent to guess behavior beyond the basic fetch operation.

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?

The input schema already provides a clear description for the only parameter (source_token with fallback), and the tool description adds no additional semantic value beyond confirming the parameter's role.

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 it fetches the most recent log events for a source, using a specific verb and resource, and distinguishes it from sibling tools like execute_query by focusing on recent events for tailing and triage.

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

Usage Guidelines3/5

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

The description mentions usefulness for tailing and incident triage, but does not explicitly contrast with alternatives like execute_query for filtering or aggregating, leaving when-not-to-use unclear.

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