Skip to main content
Glama
fasterv410

logflare-mcp

by fasterv410

Execute ad-hoc SQL

execute_query

Run ad-hoc SQL queries on BigQuery, Postgres, or ClickHouse. Choose the dialect that matches your data source and execute instantly.

Instructions

Run an ad-hoc SQL query. Provide exactly one dialect: BigQuery, Postgres, or ClickHouse. Prefer query_endpoint when a saved endpoint exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bq_sqlNoBigQuery SQL.
pg_sqlNoPostgres SQL.
ch_sqlNoClickHouse SQL.

Implementation Reference

  • The executeQuery method in LogflareClient that makes the actual API call to /api/query with the SQL parameters.
    executeQuery(args: {
    	bqSql?: string
    	pgSql?: string
    	chSql?: string
    }) {
    	const query: Record<string, string> = {}
    	if (args.bqSql) query.bq_sql = args.bqSql
    	if (args.pgSql) query.pg_sql = args.pgSql
    	if (args.chSql) query.ch_sql = args.chSql
    	return this.request<unknown>('/api/query', { query })
    }
  • src/index.ts:156-184 (registration)
    The server.registerTool call for 'execute_query' that defines the input schema (bq_sql, pg_sql, ch_sql) and handler that validates exactly one SQL dialect is provided, then delegates to client.executeQuery.
    server.registerTool(
    	'execute_query',
    	{
    		title: 'Execute ad-hoc SQL',
    		description:
    			'Run an ad-hoc SQL query. Provide exactly one dialect: BigQuery, Postgres, or ClickHouse. ' +
    			'Prefer query_endpoint when a saved endpoint exists.',
    		inputSchema: {
    			bq_sql: z.string().optional().describe('BigQuery SQL.'),
    			pg_sql: z.string().optional().describe('Postgres SQL.'),
    			ch_sql: z.string().optional().describe('ClickHouse SQL.'),
    		},
    	},
    	async ({ bq_sql, pg_sql, ch_sql }) => {
    		const provided = [bq_sql, pg_sql, ch_sql].filter(Boolean).length
    		if (provided !== 1) {
    			return errorText(
    				'Provide exactly one of bq_sql, pg_sql, or ch_sql.',
    			)
    		}
    		try {
    			return text(
    				await client.executeQuery({ bqSql: bq_sql, pgSql: pg_sql, chSql: ch_sql }),
    			)
    		} catch (err) {
    			return errorText(err)
    		}
    	},
    )
  • Zod input schema for execute_query defining three optional string parameters: bq_sql, pg_sql, ch_sql.
    inputSchema: {
    	bq_sql: z.string().optional().describe('BigQuery SQL.'),
    	pg_sql: z.string().optional().describe('Postgres SQL.'),
    	ch_sql: z.string().optional().describe('ClickHouse SQL.'),
    },
Behavior2/5

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

No annotations are provided, and the description lacks details on side effects, permissions, or return format. For an execution tool, this is insufficient transparency.

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, no fluff, front-loaded with the action and key constraint.

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?

Adequately describes input constraints but omits output/return information. With no output schema, more behavioral context would improve completeness.

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

Parameters4/5

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

Schema covers 100% of parameters, and the description adds the constraint that exactly one dialect should be provided, which is not evident from the schema alone.

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 tool runs an ad-hoc SQL query and specifies the dialects (BigQuery, Postgres, ClickHouse), distinguishing it from sibling tools like query_endpoint.

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 instructs to provide exactly one dialect and prefers query_endpoint when a saved endpoint exists, offering clear guidance on tool selection.

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