Skip to main content
Glama

Filter a layer (direct)

filter_layer

Narrow a layer to features matching a structured predicate. append:true (default) conjoins with any existing filter; append:false replaces the chain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appendNoDefault true. false replaces the layer's existing filter chain.
intentNoOptional. Which mental model is this filter operating under? "narrow" = generic shrink-the-set; "isolate-outliers" = pull out anomalies for inspection; "compare-subset" = pre-step before a side-by-side compare; "preview-data" = exploratory peek; "other" = none of the above.
map_idYes
layerIdYesid of the layer to filter
predicateYesPredicate in the Mongo-shape grammar. Examples: {op:"eq",field:"category",value:"cafe"}, {op:"gt",field:"magnitude",value:5}, {op:"within",geometry:{type:"Polygon",coordinates:[...]}}, {op:"and",children:[...]}. See docs/superpowers/specs/2026-04-17-workspace-ops-log-design.md §6.
rationaleNoOptional short label (≤300 chars) for the map edit history, e.g. "add wildfire layer". Omit it to send nothing beyond the tool arguments.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / rationale / description
      Previous value: -"Short audit-log label (≤300 chars) stating the user-facing goal this call serves, e.g. \"add wildfire layer for the user's California query\". Required on every call. Stored in the operations log so map edits stay traceable — we never see your chat history."New value: +"Optional short label (≤300 chars) for the map edit history, e.g. \"add wildfire layer\". Omit it to send nothing beyond the tool arguments."
    • changedInput schema / required
      Previous value: -[
      -  "map_id",
      -  "layerId",
      -  "predicate",
      -  "rationale"
      -]New value: +[
      +  "map_id",
      +  "layerId",
      +  "predicate"
      +]
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false and idempotentHint=false, so the safety profile is partly covered. The description adds real behavioral value beyond that by stating the append default and that append:false 'replaces the chain' — disclosing what existing state is overwritten. It stops short of permission/reversibility notes.

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 tight sentences, fully front-loaded: the core action first, then the append/replace distinction. No filler, every clause earns its place.

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 a mutation tool with annotations covering the safety profile and a high-coverage schema handling parameters and the nested predicate grammar, the description supplies enough to invoke correctly. Missing only edge context such as permissions or interaction with undo/clear_filters.

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 83%, so the schema already documents append, intent, predicate, and rationale in detail. The description only reinforces append behavior, which the schema already explains, adding little beyond the structured fields. Baseline 3 is appropriate when the schema carries the load.

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?

States a specific verb+resource+scope: 'narrow a layer to features matching a structured predicate.' An agent can tell this apart from clear_filters and query_features by the 'narrow a layer' framing. However, it never names an alternative sibling directly, so differentiation is inferred rather than explicit.

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?

Usage is implied by 'narrow a layer' but there is no explicit when-to-use/when-not or pointer to alternatives like clear_filters (to remove) or select_within/query_features. The append semantics hint at the additive-vs-replace decision but don't frame it as tool selection guidance.

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.

Resources