Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

multi_filter

Filter arrays of JSON objects using multiple conditions combined with AND/OR logic, so you can isolate only the records that match your query criteria.

Instructions

Filter an array of objects with multiple conditions combined by AND/OR.

Each condition is a dict with keys: field, operator, value. Operators: eq, neq, gt, gte, lt, lte, contains, regex.

Examples:

  • [{"field": "status", "operator": "eq", "value": "active"}, {"field": "score", "operator": "gt", "value": 80}]

  • mode="and" means ALL conditions must match.

  • mode="or" means ANY condition can match.

Args: alias: The alias of the loaded document. path: Dot-notation path to the array of objects. conditions: List of condition dicts. mode: "and" or "or" (default "and").

Returns: The filtered objects with a match count header.

Input Schema

NameRequiredDescriptionDefault
modeNoand
pathYes
aliasYes
conditionsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It does disclose the operator vocabulary, the condition dict shape, and that the return is 'the filtered objects with a match count header', which is useful. It does not state that the operation is non-mutating, how invalid operators/fields are handled, or whether result order is preserved.

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 purpose sentence, then a compact operator list, two concrete examples, and terse Args/Returns sections. Every block earns its place, though the mode explanation is duplicated between the bulleted examples and the Args section.

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?

An output schema exists, so the Returns line is a bonus rather than a necessity, and the condition sub-structure is fully documented where the schema leaves it as a bare object with additionalProperties. The main remaining gap is sibling disambiguation against filter_objects, which the description never addresses.

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 description coverage is 0%, so the description must carry the parameters, and it largely does: path is 'Dot-notation path to the array of objects', alias is 'the alias of the loaded document', conditions' internal keys (field/operator/value) and the full operator set are enumerated, and mode's allowed values are spelled out. Only 'alias' remains thin, assuming prior knowledge of the load_json workflow.

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 opening sentence gives a specific verb and resource ('Filter an array of objects') plus the distinguishing capability (multiple conditions combined by AND/OR). It is clear what the tool does, but it never contrasts itself with the sibling filter_objects or jsonpath_query, so an agent must guess which filter tool to pick.

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 only implied by the mechanics: mode='and' vs mode='or' is explained, and the examples show the condition shape. There is no explicit statement of when to choose this over filter_objects (single condition?) or jsonpath_query, and no prerequisites or failure conditions are given.

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