Skip to main content
Glama

query_database

Retrieve and analyze flight records from EMS databases using customizable queries, filters, sorting, and aggregation functions.

Instructions

Query flight records from a database.

Accepts field names (e.g. "Flight Date"), [N] reference numbers from find_fields, or raw bracket-encoded IDs. Database names (e.g. "FDW Flights") are also resolved automatically.

Supports aggregation (avg/count/max/min/stdev/sum/var) and discrete filter auto-resolution (string labels resolved to numeric codes automatically).

Args: ems_system_id: EMS system ID. database_id: Database ID or name (e.g. "FDW Flights"). fields: Fields to retrieve. Each has field_id (name, [N] ref, or bracket ID), optional alias, optional aggregate. filters: Filter conditions (AND-combined). Each has field_id, operator (equal/notEqual/greaterThan/lessThan/between/in/like/isNull/etc.), value. order_by: Sort order. Each has field_id, optional direction (asc/desc). limit: Max rows (1-10000, default: 100). format: 'display' (human-readable, default) or 'raw' (numeric codes). output_format: 'table' (default), 'csv' (compact), or 'json' (structured).

Returns: Results in the requested output format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ems_system_idYes
database_idYes
fieldsYes
filtersNo
order_byNo
limitNo
formatNodisplay
output_formatNotable

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes some behavioral aspects: aggregation support, filter auto-resolution, format options, and return behavior. However, it doesn't cover important aspects like rate limits, authentication requirements, error handling, or whether this is a read-only operation (though 'query' implies read). The description adds value but doesn't fully compensate for the lack of 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 well-structured with clear sections (purpose, parameter explanations, returns). It's appropriately sized for an 8-parameter tool with complex functionality. Some sentences could be more concise (e.g., the 'fields' explanation is somewhat verbose), but overall it's efficient and front-loaded with the core purpose.

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

Completeness4/5

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

Given the tool's complexity (8 parameters, no annotations, 0% schema coverage), the description does a good job of providing context. It explains most parameter semantics, describes behavioral aspects like aggregation and auto-resolution, and mentions the return format. The existence of an output schema means it doesn't need to explain return values in detail. The main gap is lack of sibling tool differentiation and some behavioral aspects like error handling.

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?

With 0% schema description coverage, the description must compensate for the schema's lack of parameter documentation. It does an excellent job explaining parameter semantics: it clarifies what 'fields' accepts (field names, reference numbers, bracket IDs), explains the aggregation options, describes filter operators, and details the format/output_format options. The only gap is that it doesn't explain 'ems_system_id' or 'database_id' beyond mentioning they're IDs/names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query flight records from a database.' It specifies the verb ('query') and resource ('flight records'), but doesn't explicitly differentiate from sibling tools like 'query_flight_analytics' or 'search_analytics', which might have overlapping functionality. The mention of 'database' provides some context but not full sibling differentiation.

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 minimal usage guidance. It mentions that database names are resolved automatically and references 'find_fields' for field references, but doesn't explain when to use this tool versus alternatives like 'query_flight_analytics' or 'search_analytics'. No explicit when/when-not guidance or prerequisite information is provided.

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/mattsq/ems-mcp'

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