Skip to main content
Glama

bharatlas

query_layer

Read-onlyIdempotent

Query a layer's data with filters and grouping. Reads the parquet file at runtime. Supports: select specific columns, filter by column values, group by a column to get counts, and sum numeric columns per group (e.g. roll block areas up to district totals). Use get_layer_schema first to discover column names. Examples: 'airports in Karnataka' -> where: {state: 'KA'}, 'forest types' -> group_by: 'type', 'health facilities in Bihar' -> where: {state: 'BIHAR'}, select: ['name', 'type'].

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "layer_id": "<layer_id>"
    },
    "name": "query_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
sumNoNumeric columns to total per group (requires group_by). Adds {sums: {group: {col: total}}}. Use this to roll finer units up, e.g. block-level areas to district totals. Shares/percentages are not additive: sum the area columns and recompute shares.
limitNoMax rows (default 100, max 1000)
whereNoFilter conditions as {column: value} pairs. Exact, case-insensitive match on flat columns (not partial). Values may contain commas.
selectNoColumn names to return. Omit for all non-geometry columns.
group_byNoColumn to group by. Returns {value: count} instead of rows.
layer_idYesLayer ID to query
include_centroidNoInclude _lat/_lng centroid coordinates (defaults to true). Set false to exclude.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds the runtime parquet read (a latency/cost hint) and the get_layer_schema prerequisite, but the remaining behavior it describes (grouped counts, default limits, centroid output) is already documented in the schema, so added value is moderate.

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?

Front-loaded with purpose and capabilities before the prerequisite and examples, so an agent can stop reading early. The trailing example list is somewhat repetitive with the capability list, but each sentence still carries usable information.

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?

With 7 parameters including a nested object and no output schema, the description does the necessary work by sketching return shapes ('{value: count}', '{sums: {group: {col: total}}}') and warning that shares are not additive. Minor gaps remain around pagination behavior and what happens to geometry columns, but nothing critical to a correct call is missing.

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 coverage is 100%, so the baseline would be 3, but the description goes beyond it by mapping natural-language intents onto parameter combinations ('airports in Karnataka' -> where: {state: 'KA'}, 'forest types' -> group_by: 'type'). That translation guidance is genuinely useful and not recoverable 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?

Opens with a specific verb+resource ('Query a layer's data') and immediately enumerates the four supported operations (select, filter, group, sum). The runtime note ('Reads the parquet file at runtime') tells the agent this is live data, not a cache, and the examples make the scope concrete.

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

Usage Guidelines4/5

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

'Use get_layer_schema first to discover column names' is an explicit prerequisite that routes the agent to the right sibling in the correct order. It stops short of saying when to prefer this over locate/nearby or when a query is the wrong tool, so no true when-not guidance is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.