List Objects
list_objectsBrowse Gramps Web records by type one page at a time, filter by fields or relationship rules, and sort results to retrieve Gramps IDs, summaries, handles, and total counts.
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), filter by field values (gql) or select by relationships with Gramps filter rules (rules), 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. rules run first and gql must then also match; grampsId cannot be combined with rules. Filtering runs on the Gramps Web server: invalid gql returns its error, invalid rules are explained, and an ID, tag or saved filter the tree lacks matches nothing instead of failing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gql | No | Filter in Gramps Query Language, run on the server: 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 before 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"]}. 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 gql by and (optional). Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects. |