Skip to main content
Glama

La Query

la_query
Read-onlyIdempotent

Run a raw SoQL query against any Los Angeles open-data resource (data.lacity.org) by its Socrata id (8-char like "2nrs-mtv8"). Full SoQL: where/select/group/order/limit/offset. Use la_datasets to find a resource id, or la_recent for the common ones.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "limit": 100,
      "where": "crm_cd_desc='BURGLARY'",
      "_apiKey": "your-data-la-api-key",
      "resource_id": "2nrs-mtv8"
    },
    "name": "la_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
groupNoSoQL $group (e.g. "crm_cd_desc").
limitNoMax rows (default 100, max 5000).
orderNoSoQL $order (e.g. "date_occ DESC").
whereNoSoQL $where filter (e.g. "area_name='Central'").
offsetNoRow offset for paging.
selectNoSoQL $select (e.g. "crm_cd_desc, count(*)").
_apiKeyNoOptional, your own Socrata app token for higher rate limits. Omit to use the keyless endpoint.
resource_idYesSocrata resource id, e.g. "2nrs-mtv8" (crime data).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / _apiKey / description
      Previous value: -"Optional — your own Socrata app token for higher rate limits. Omit to use the keyless endpoint."New value: +"Optional, your own Socrata app token for higher rate limits. Omit to use the keyless endpoint."
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "_apiKey": "your-data-la-api-key",
      +    "limit": 100,
      +    "resource_id": "2nrs-mtv8",
      +    "where": "crm_cd_desc='BURGLARY'"
      +  },
      +  {
      +    "_apiKey": "your-data-la-api-key",
      +    "group": "crm_cd_desc",
      +    "limit": 20,
      +    "order": "count(*) DESC",
      +    "resource_id": "2nrs-mtv8",
      +    "select": "crm_cd_desc, count(*)"
      +  }
      +]
  3. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety and liveness profile is covered. The description adds the "raw SoQL" framing and supported clause set but says nothing about result shape, error behavior on bad SoQL, or the 5000-row ceiling's implications. Useful addition, but modest relative to a fully annotated tool.

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?

Three short sentences: what it does, what query surface is available, and where to get an id. Front-loaded with the core action and no redundant restatement of the title or parameters.

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?

For an 8-parameter, no-output-schema tool, the description is nearly sufficient: action, scope, query language surface, and id-discovery path are all present. The remaining gap is what a call returns (row array? metadata?) and failure modes, which an agent would have to discover empirically.

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?

Schema description coverage is 100% and each SoQL parameter already carries its own example (where, select, group, order, limit, offset, resource_id). The description's enumeration of supported clauses mirrors the schema rather than adding semantics such as how clauses combine or how offset paging should be driven. Baseline 3 applies when the schema does the heavy lifting.

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?

"Run a raw SoQL query against any Los Angeles open-data resource (data.lacity.org) by its Socrata id" gives a specific verb (run a raw query), a specific domain, and the exact identifying key, even showing the id format. It is immediately distinguishable from siblings like la_datasets (catalog lookup) and la_recent (curated shortcuts).

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?

It explicitly routes the agent: use la_datasets to find a resource id, or la_recent for common ones, implying this tool is for arbitrary/custom queries. That is explicit when-to-use plus named alternatives, with nothing left to inference.

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.