Skip to main content
Glama
ianderso
by ianderso

create_filter

Save reusable custom filters from Gramps rules so repeated selections run by name instead of being rebuilt. Define name, namespace, and rules to audit a scope or branch consistently.

Instructions

Save a reusable custom filter built from Gramps' own rules.

Worth doing for a selection you will run repeatedly — an audit scope, a branch of the tree — because the filter then has a name rather than being retyped each time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesFilter name, used to apply it later.
rulesYesRules, each {'name': <rule>, 'values': [...], 'regex': false}. Rule names come from list_filter_rules.
invertNoReturn everything the rules do NOT match.
commentNoNote on the filter's purpose.
functionNoHow rules combine: 'and', 'or', or 'one'.and
namespaceYesSingular, capitalised: Person, Family, Event, Place, Citation, Source, Repository, Media, Note.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare this as a non-read-only, non-destructive, non-idempotent write. The description adds that the result is persisted and reappliable, but never warns that repeated calls with the same name are not idempotent (idempotentHint=false), nor describes permissions or duplicate-name behaviour. It adds some context but leaves the main behavioural risk unstated.

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?

Two short paragraphs, purpose first, rationale second; there is no filler and the alternative/rationale clause is front-loaded within its sentence. The second paragraph is slightly padding-like for an agent that only needs invocation facts, costing it a point.

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

Completeness3/5

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

For a 6-parameter mutation with no output schema, the description never states what is returned (a filter handle/ID? the saved object?) or what happens on a name collision. With annotations and 100% schema coverage the remainder is adequate, but the return-value gap is real.

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% across all 6 parameters, including the plain-language hints for namespace, rules, function and invert, so the schema carries the parameter semantics. The description adds no syntax or format detail beyond what is already documented (e.g. the list_filter_rules reference for rule names lives in the schema).

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?

States a specific verb and resource (save/create a reusable custom filter) plus the constraint that it is built from Gramps' own rules. An agent can immediately distinguish it from the sibling reads (list_custom_filters) and destructive operation (delete_filter) without opening the schema.

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?

The second paragraph gives an explicit when-to-use cue: pick this for a selection you will run repeatedly (audit scope, branch of the tree) because the filter gains a name instead of being retyped. It stops short of naming alternatives such as list_custom_filters or delete_filter, and gives no when-not guidance.

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