Skip to content

Notes endpoint GQL queries fail with server error despite API documentation #686

@MPietrala

Description

@MPietrala

Background

I'm developing an MCP (Model Context Protocol) server that provides AI assistants
with access to Gramps genealogy data through the Gramps Web API. The MCP server implements various search tools that use GQL
(Gramps Query Language) to filter and find records across different entity types.

Related issue in my repository: cabout-me/gramps-mcp#4

Problem

The /notes endpoint returns "Server error. Please try again later." when I use GQL queries, despite the API
documentation
explicitly listing gql as a supported query parameter.

API Documentation vs Reality

The GET /notes endpoint documentation shows:

gql (string, query): A Gramps QL query string that is used to filter the objects.
Example: tag_list.length >= 10

However, any GQL query on notes results in server errors.

Failing Examples

All of these GQL queries return "Server error. Please try again later.":

  • text.string ~ "MyHeritage" - search note text content
  • gramps_id ~ "N0001" - search by Gramps ID
  • type.string ~ "event" - search by note type
  • tag_list.length >= 10 - the example from the API docs

Working Comparison

Other endpoints work correctly with identical GQL syntax:

  • GET /people?gql=primary_name.first_name ~ "John"
  • GET /events?gql=date.dateval[2] > 1800
  • GET /places?gql=name.value ~ "Boston"
  • GET /notes?gql=text.string ~ "test" ❌ Server error

Environment

  • Gramps Web API version: [please specify your version]
  • Testing through MCP server making REST API calls
  • Same authentication/setup works for all other endpoints

This appears to be a bug in the notes endpoint implementation where GQL parsing/filtering is not properly handled, despite
being documented as supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions