List Objects
list_objectsBrowse records of one type page by page, optionally filtered or sorted, to find a Gramps ID, list a source's citations, or apply Gramps filter rules.
Instructions
List the records of one type a page at a time, optionally filtered and sorted: one line per record (Gramps ID, summary, handle) with the page and total count. Use it to browse a type, fetch one Gramps ID, list a source's citations (sourceHandle), or filter with Gramps filter rules (rules): by field values with the MatchesQuery rule, or by relationships, such as a person's ancestors or people with no family links. To find records by text use search; to read one record in full use get_object. gql, the older field filter, works only before Gramps Web API 3.26 and must match as well as rules; grampsId cannot be combined with rules. Filtering runs on the Gramps Web server: invalid rules are explained, invalid gql returns its error, and an ID, tag or saved filter the tree lacks matches nothing instead of failing.
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": {
"objectType": "<objectType>"
},
"name": "list_objects"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gql | No | Filter in Gramps Query Language, run on the server; only before Gramps Web API 3.26, which removed it (use the MatchesQuery rule in rules instead): field = value with a single = (not ==), also !=, <, <=, >, >=, ~ (contains), !~, and, or and parentheses; text goes in double quotes. Types are numbers, not names, e.g. event type.value = 12 Birth, 13 Death, 1 Marriage, 15 Baptism, 19 Burial. Examples: gender = 1 (male), primary_name.first_name = "Anna", media_list.length >= 1 (optional). | |
| page | No | Page number, from 1 (default 1). | |
| sort | No | Field to sort by, e.g. gramps_id; a leading - sorts descending, e.g. -change for latest edits first (optional). | |
| rules | No | Gramps filter rules, run on the server (with gql a record must match both): {"function": "and" (default), "or" or "one", "invert": true to keep the records that do not match, "rules": [{"name": rule, "values": [one per label of the rule, in order]}]}, or just the array of rules. Values are Gramps IDs (I0001), text, numbers or true/false. An item of rules can be a nested filter of the same form; with "namespace" (Event, Family, Person, Place, Source or Repository) it matches the records each listed one links to, e.g. people by their events. Examples: people with no family links {"rules": [{"name": "Disconnected"}]}; people not related to I0001 {"invert": true, "rules": [{"name": "IsRelatedWith", "values": ["I0001"]}]}; a saved filter {"name": "MatchesFilter", "values": ["its name"]}. Field values (Gramps Web API 3.23+): MatchesQuery with a Python-like GOQL expression, == for equals, text in single quotes, len(list) for a list's length, e.g. {"name": "MatchesQuery", "values": ["primary_name.first_name == 'Anna' and len(media_list) >= 1"]}; events of a type: type.value == EventType.BIRTH. Rules of each type and their values: get_reference(topic: "filter-rules", section: type). Not for tags (optional). | |
| grampsId | No | Only the record with this Gramps ID, e.g. I0001 (not a handle; optional). | |
| pagesize | No | Records per page, 1–100 (default 20). | |
| objectType | Yes | Which records to list: people, families, events, places, sources, citations, repositories, notes, media or tags. | |
| sourceHandle | No | With objectType citations only: list just the citations of this source; combined with rules and gql by and (optional). Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects. |