{
    "version": "90bdda12e80e",
    "base_path": "/api/agent",
    "tools": [
        {
            "name": "me",
            "capability": "me",
            "title": "Who am I",
            "description": "Returns the user and office this API key acts for, the key's scopes (what it may do) and the rate limits. Call it first to learn which operations are available; needs no scope.",
            "scope": null,
            "input_schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "user": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "language": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false
                    },
                    "office": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "timezone": {
                                "type": "string",
                                "description": "IANA zone the API reads and writes timestamps in, e.g. Europe/Budapest."
                            },
                            "currency_id": {
                                "type": "integer",
                                "description": "The office currency (Flowyer currency id): costs.create books in it when currency_id is omitted."
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "ISO code of the office currency, e.g. HUF, EUR, RON."
                            }
                        },
                        "additionalProperties": false
                    },
                    "key": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name the user gave this key, or the connected app for an OAuth token."
                            },
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\" = a static API key, \"oauth\" = an OAuth 2.1 access token."
                            },
                            "prefix": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "First characters of a static key, for identification only; null for OAuth."
                            },
                            "expires_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "last_used_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Scopes of this credential, e.g. \"matters:read\". An operation whose scope is missing answers 403."
                    },
                    "available_scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "All scopes the key owner could enable in Flowyer."
                    },
                    "limits": {
                        "type": "object",
                        "properties": {
                            "requests_per_minute": {
                                "type": "integer"
                            },
                            "list_max_limit": {
                                "type": "integer"
                            }
                        },
                        "additionalProperties": false
                    },
                    "channel": {
                        "type": "string",
                        "enum": [
                            "rest",
                            "mcp"
                        ],
                        "description": "How the request reached Flowyer."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/me",
                "args": {}
            }
        },
        {
            "name": "colleagues_list",
            "capability": "colleagues.list",
            "title": "List colleagues",
            "description": "Lists the active colleagues of the office (id, name) for assigned_to_user_id / responsible_user_id. With `q` (a name as heard; accents, casing and small typos tolerated) answers status exact/similar/none like the resolve tools: only \"exact\" is safe to use directly.",
            "scope": "colleagues:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "q": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "A colleague's name to look up, as heard or dictated, in any word order. Omit it to list every active colleague.",
                        "examples": [
                            "Nagy Péter"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500,
                        "description": "Maximum colleagues to return (default 200).",
                        "default": 200
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "exact",
                            "similar",
                            "none",
                            null
                        ],
                        "description": "Only with `q`: exact = one confident match (safe to use its id), similar = approximate or several matches (confirm with the user first), none = no match (ask the user). Null without `q`."
                    },
                    "colleagues": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "description": "User id: pass it as assigned_to_user_id / responsible_user_id."
                                },
                                "name": {
                                    "type": "string",
                                    "description": "Display name as Flowyer shows it (with the title, if any)."
                                },
                                "title": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Name prefix such as \"Dr.\", or null."
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Active colleagues, best match first with `q`, otherwise by name."
                    },
                    "total": {
                        "type": "integer",
                        "description": "How many colleagues matched (all active colleagues without `q`) before the list was cut to `limit`."
                    },
                    "truncated": {
                        "type": "boolean",
                        "description": "True when more colleagues matched than were returned: narrow `q` or raise `limit`."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/colleagues",
                "args": {
                    "q": "query",
                    "limit": "query"
                }
            }
        },
        {
            "name": "matters_list",
            "capability": "matters.list",
            "title": "List matters",
            "description": "Lists the matters (cases) the user may see, newest first. Use it to find a matter by case number, subject or client before referring to it elsewhere. Archived matters are hidden unless `include_archived` is true. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "matters:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Free-text search in the subject and the client names (accents and case ignored) and the office's other case numbers; or a case number, either exactly as returned in case_number (the office numbering scheme) or as year/sequence such as \"2026/0025\".",
                        "examples": [
                            "2026/0025"
                        ]
                    },
                    "client_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only matters of this client.",
                        "examples": [
                            512
                        ]
                    },
                    "responsible_user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only matters this user (ids from colleagues.list) is responsible for: as the main responsible, an additional responsible, or a member of a responsible workgroup (as the web colleague filter)."
                    },
                    "updated_since": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Only matters changed at or after this time (ISO 8601).",
                        "examples": [
                            "2026-10-01T00:00:00+02:00"
                        ]
                    },
                    "include_archived": {
                        "type": "boolean",
                        "description": "Include archived matters.",
                        "default": false
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Matter id. Use it as `matter_id` elsewhere.",
                        "examples": [
                            1234
                        ]
                    },
                    "case_number": {
                        "type": "string",
                        "description": "Case number as displayed in Flowyer, in the office numbering scheme.",
                        "examples": [
                            "2026/0025"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft. v. Nagy Bt. - contract dispute"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "archived"
                        ]
                    },
                    "case_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "case_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the case type."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the responsible lawyer."
                    },
                    "clients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Clients (principals) of the matter."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "restricted": {
                        "type": "boolean",
                        "description": "True when only the responsible lawyers may see the matter (Chinese wall)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters",
                "args": {
                    "q": "query",
                    "client_id": "query",
                    "responsible_user_id": "query",
                    "updated_since": "query",
                    "include_archived": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "matters_resolve",
            "capability": "matters.resolve",
            "title": "Resolve matter by name",
            "description": "Finds a matter by a spoken or misspelled subject or client name (accents, casing, small typos tolerated). Returns status exact/similar/none and candidates. Only \"exact\" is safe to use directly; else confirm with the user. Many lookalikes are never \"exact\": narrow with client_id or a fuller name.",
            "scope": "matters:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "description": "Matter subject or client name to look up, as heard or dictated.",
                        "examples": [
                            "ingatlan adásvétel"
                        ]
                    },
                    "client_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Only matters of this client (use after clients.resolve returned an exact client)."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10,
                        "description": "Maximum candidates to return (default 5).",
                        "default": 5
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "exact",
                            "similar",
                            "none"
                        ],
                        "description": "exact = one confident match (safe to use its id). similar = one or more approximate matches, confirm with the user first. none = no match, ask the user."
                    },
                    "matters": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "description": "Matter id. Use it as `matter_id` elsewhere.",
                                    "examples": [
                                        1234
                                    ]
                                },
                                "case_number": {
                                    "type": "string",
                                    "description": "Case number as displayed in Flowyer, in the office numbering scheme.",
                                    "examples": [
                                        "2026/0025"
                                    ]
                                },
                                "subject": {
                                    "type": "string",
                                    "examples": [
                                        "Kovács Kft. v. Nagy Bt. - contract dispute"
                                    ]
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "active",
                                        "archived"
                                    ]
                                },
                                "case_type_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "case_type": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Localized name of the case type."
                                },
                                "responsible_user_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "responsible": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Display name of the responsible lawyer."
                                },
                                "clients": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        },
                                        "additionalProperties": false
                                    },
                                    "description": "Clients (principals) of the matter."
                                },
                                "started_on": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date"
                                },
                                "restricted": {
                                    "type": "boolean",
                                    "description": "True when only the responsible lawyers may see the matter (Chinese wall)."
                                },
                                "created_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "updated_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "created_via_api": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {
                                        "kind": {
                                            "type": "string",
                                            "enum": [
                                                "key",
                                                "oauth"
                                            ],
                                            "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                                        },
                                        "key_id": {
                                            "type": "integer",
                                            "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                                        },
                                        "key_name": {
                                            "type": "string",
                                            "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                                        },
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "user": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        }
                                    },
                                    "additionalProperties": false,
                                    "description": "Present when an external agent created the record through this API."
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Candidate matters, best match first."
                    },
                    "total": {
                        "type": "integer",
                        "description": "How many matters matched before the list was cut to `limit`."
                    },
                    "truncated": {
                        "type": "boolean",
                        "description": "True when more matters matched than were returned, or too many lookalikes existed to check them all; narrow with client_id or a fuller name, or raise `limit`, rather than choosing from an incomplete list."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/resolve",
                "args": {
                    "name": "query",
                    "client_id": "query",
                    "limit": "query"
                }
            }
        },
        {
            "name": "matters_get",
            "capability": "matters.get",
            "title": "Get matter",
            "description": "Returns one matter (case) with its clients and details. Answers 404 when the matter does not exist or the user may not see it.",
            "scope": "matters:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Matter id. Use it as `matter_id` elsewhere.",
                        "examples": [
                            1234
                        ]
                    },
                    "case_number": {
                        "type": "string",
                        "description": "Case number as displayed in Flowyer, in the office numbering scheme.",
                        "examples": [
                            "2026/0025"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft. v. Nagy Bt. - contract dispute"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "archived"
                        ]
                    },
                    "case_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "case_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the case type."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the responsible lawyer."
                    },
                    "clients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Clients (principals) of the matter."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "restricted": {
                        "type": "boolean",
                        "description": "True when only the responsible lawyers may see the matter (Chinese wall)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "litigious": {
                        "type": "boolean"
                    },
                    "archived_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the matter was archived, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "matters_create",
            "capability": "matters.create",
            "title": "Create matter",
            "description": "Opens a matter (case) with the next case number of the year. Needs at least one existing client (find or create it first). The responsible lawyer defaults to the key's user and is notified otherwise. Parties, contacts and fees are set in Flowyer.",
            "scope": "matters:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "subject": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "Short title of the matter as it appears in lists. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Kovács Kft. v. Nagy Bt. - contract dispute"
                        ]
                    },
                    "case_type_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Case type (area of law) id from the global Flowyer case-type list: pick the one whose name matches the user's words, or ask the user to choose by name. An unknown id answers 422 with details.known_case_types (id + localized name); an existing matter shows its type in matters.get `case_type_id` / `case_type`."
                    },
                    "client_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "minItems": 1,
                        "maxItems": 20,
                        "description": "Ids of the clients (principals). At least one, at most 20.",
                        "examples": [
                            [
                                512
                            ]
                        ]
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Responsible lawyer: a user id from colleagues.list (look a dictated name up there). Default: the user behind the key."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Start date, YYYY-MM-DD. Default: today.",
                        "examples": [
                            "2026-10-29"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "description": "Longer description, plain text."
                    },
                    "main_case_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "description": "The office's own main reference number of the matter. Required when the office numbering scheme uses it (the API answers 422 otherwise)."
                    },
                    "restricted": {
                        "type": "boolean",
                        "description": "true = only the responsible lawyers may see the matter (Chinese wall).",
                        "default": false
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "subject",
                    "case_type_id",
                    "client_ids"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Matter id. Use it as `matter_id` elsewhere.",
                        "examples": [
                            1234
                        ]
                    },
                    "case_number": {
                        "type": "string",
                        "description": "Case number as displayed in Flowyer, in the office numbering scheme.",
                        "examples": [
                            "2026/0025"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft. v. Nagy Bt. - contract dispute"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "archived"
                        ]
                    },
                    "case_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "case_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the case type."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the responsible lawyer."
                    },
                    "clients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Clients (principals) of the matter."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "restricted": {
                        "type": "boolean",
                        "description": "True when only the responsible lawyers may see the matter (Chinese wall)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "litigious": {
                        "type": "boolean"
                    },
                    "archived_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the matter was archived, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters",
                "args": {
                    "subject": "body",
                    "case_type_id": "body",
                    "client_ids": "body",
                    "responsible_user_id": "body",
                    "started_on": "body",
                    "description": "body",
                    "main_case_number": "body",
                    "restricted": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "matters_update",
            "capability": "matters.update",
            "title": "Update matter",
            "description": "Changes a matter's subject, description, start date, litigious flag or responsible lawyer. Case number, Chinese wall, archive status, fees and client links are not editable here. Pass expected_updated_at from your last read; a conflicting change answers 409.",
            "scope": "matters:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "Short title of the matter. Plain text, at most 255 characters as a NEW value; \"<\" and \">\" cannot be introduced either, but a stored subject that is longer or contains them may be sent back unchanged. null keeps the current subject."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Longer description, plain text, at most 10000 characters as a NEW value; a longer stored description may be sent back unchanged."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Start date, YYYY-MM-DD. null keeps the current value (a start date cannot be cleared)."
                    },
                    "litigious": {
                        "type": "boolean",
                        "description": "Whether the matter is litigious."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "New responsible lawyer: an active colleague's user id from colleagues.list. They are notified when it is not you. Sending the current one - or null / 0, which a matter without a responsible reads back as - changes nothing."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Matter id. Use it as `matter_id` elsewhere.",
                        "examples": [
                            1234
                        ]
                    },
                    "case_number": {
                        "type": "string",
                        "description": "Case number as displayed in Flowyer, in the office numbering scheme.",
                        "examples": [
                            "2026/0025"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft. v. Nagy Bt. - contract dispute"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "archived"
                        ]
                    },
                    "case_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "case_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the case type."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the responsible lawyer."
                    },
                    "clients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Clients (principals) of the matter."
                    },
                    "started_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "restricted": {
                        "type": "boolean",
                        "description": "True when only the responsible lawyers may see the matter (Chinese wall)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "litigious": {
                        "type": "boolean"
                    },
                    "archived_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the matter was archived, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/matters/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "subject": "body",
                    "description": "body",
                    "started_on": "body",
                    "litigious": "body",
                    "responsible_user_id": "body"
                }
            }
        },
        {
            "name": "matters_responsibles",
            "capability": "matters.responsibles",
            "title": "List matter responsibles",
            "description": "Lists the ADDITIONAL responsibles of a matter (the primary responsible is on matters.get): each is a colleague (type \"user\", user_id set) or a workgroup (type \"workgroup\", workgroup_id set), all of whom can see the matter. Answers 404 when the matter is not visible. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "matters:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "user",
                            "workgroup"
                        ],
                        "description": "\"user\" = a single colleague; \"workgroup\" = every member of a workgroup."
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Colleague user id for a \"user\" entry (pass it as user_id to matters.responsibles.add); null for a workgroup."
                    },
                    "workgroup_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Workgroup id for a \"workgroup\" entry; null for a single colleague. Workgroup responsibles are managed in Flowyer."
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the colleague or workgroup."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/responsibles",
                "args": {
                    "id": "path",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "matters_responsibles_add",
            "capability": "matters.responsibles.add",
            "title": "Add matter responsible",
            "description": "Adds a colleague (user_id from colleagues.list) as an additional responsible of a matter. This GIVES that colleague access to the matter, so only add someone who should see it; they are notified. Idempotent: re-adding an existing responsible makes no change.",
            "scope": "matters:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the colleague becomes responsible for (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Colleague to add: a user id from colleagues.list. Adding them gives them access to the matter.",
                        "examples": [
                            42
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "user_id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "integer",
                        "description": "The colleague now responsible for the matter."
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the colleague."
                    },
                    "already_responsible": {
                        "type": "boolean",
                        "description": "True when the colleague was already a responsible of the matter (nothing changed)."
                    },
                    "notified": {
                        "type": "boolean",
                        "description": "True when the colleague was notified they were added. Never true when the colleague is you, or when they were already responsible."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/responsibles",
                "args": {
                    "id": "path",
                    "user_id": "body"
                }
            }
        },
        {
            "name": "clients_list",
            "capability": "clients.list",
            "title": "List clients",
            "description": "Lists the office's clients (persons and companies), alphabetically; `q` searches the name (accents and case ignored), e-mail and tax number. Before creating a client, check the name with clients.resolve (it tolerates typos too). Archived clients are hidden unless `include_archived` is true. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "clients:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Search in name (accents and case ignored), e-mail and tax number.",
                        "examples": [
                            "Kovács"
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "true = natural persons only, false = companies only."
                    },
                    "include_archived": {
                        "type": "boolean",
                        "default": false
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Client id. Use it as `client_id` elsewhere.",
                        "examples": [
                            512
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft."
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "True for a natural person, false for a company."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "archived": {
                        "type": "boolean"
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/clients",
                "args": {
                    "q": "query",
                    "is_person": "query",
                    "include_archived": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "clients_resolve",
            "capability": "clients.resolve",
            "title": "Resolve client by name",
            "description": "Finds a client by a spoken or misspelled name (accents, casing and small typos tolerated). Returns status exact/similar/none and candidate clients. Only \"exact\" is safe to use directly; on \"similar\" or \"none\" ask the user. A name with many lookalikes is never \"exact\": ask for a fuller name.",
            "scope": "clients:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "description": "Client name to look up, as heard or dictated.",
                        "examples": [
                            "Józsi ingatlan"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10,
                        "description": "Maximum candidates to return (default 5).",
                        "default": 5
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "exact",
                            "similar",
                            "none"
                        ],
                        "description": "exact = one confident match (safe to use its id). similar = one or more approximate matches, confirm with the user first. none = no match, ask the user."
                    },
                    "matches": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "description": "Client id. Use it as `client_id` elsewhere.",
                                    "examples": [
                                        512
                                    ]
                                },
                                "name": {
                                    "type": "string",
                                    "examples": [
                                        "Kovács Kft."
                                    ]
                                },
                                "is_person": {
                                    "type": "boolean",
                                    "description": "True for a natural person, false for a company."
                                },
                                "email": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "phone": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "archived": {
                                    "type": "boolean"
                                },
                                "recorded_by_user_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "recorded_by": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "created_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "updated_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "created_via_api": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {
                                        "kind": {
                                            "type": "string",
                                            "enum": [
                                                "key",
                                                "oauth"
                                            ],
                                            "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                                        },
                                        "key_id": {
                                            "type": "integer",
                                            "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                                        },
                                        "key_name": {
                                            "type": "string",
                                            "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                                        },
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "user": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        }
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Candidate clients, best match first."
                    },
                    "total": {
                        "type": "integer",
                        "description": "How many clients matched before the list was cut to `limit`."
                    },
                    "truncated": {
                        "type": "boolean",
                        "description": "True when more clients matched than were returned, or too many lookalikes existed to check them all; ask the user for a fuller name or raise `limit` rather than choosing from an incomplete list."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/clients/resolve",
                "args": {
                    "name": "query",
                    "limit": "query"
                }
            }
        },
        {
            "name": "clients_get",
            "capability": "clients.get",
            "title": "Get client",
            "description": "Returns one client with address and registration details. Identity-document numbers and fee settings are never returned.",
            "scope": "clients:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Client id.",
                        "examples": [
                            512
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Client id. Use it as `client_id` elsewhere.",
                        "examples": [
                            512
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft."
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "True for a natural person, false for a company."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "archived": {
                        "type": "boolean"
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "mailing_address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "tax_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "company_registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_position": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "main_activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Main scope of activity. Companies only; null for a natural person."
                    },
                    "nationality_country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/clients/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "clients_create",
            "capability": "clients.create",
            "title": "Create client",
            "description": "Creates a client (person or company), recorded as created by the key's user. Check the name with clients.resolve first (it tolerates missing accents and typos): a 409 only catches an active client of the very same name, unless `allow_duplicate_name` is true. ID numbers and fees cannot be set.",
            "scope": "clients:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "Full name of the person or the company name. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Kovács Kft."
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "true for a natural person, false (default) for a company.",
                        "default": false
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "examples": [
                            "info@kovacskft.hu"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64,
                        "examples": [
                            "+36 1 234 5678"
                        ]
                    },
                    "address": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false,
                        "description": "Registered / home address."
                    },
                    "mailing_address": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "tax_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64,
                        "description": "Company tax number (companies only).",
                        "examples": [
                            "12345678-2-41"
                        ]
                    },
                    "company_registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64,
                        "description": "Company registration number (companies only).",
                        "examples": [
                            "01-09-123456"
                        ]
                    },
                    "representative_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Companies only."
                    },
                    "representative_position": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Companies only."
                    },
                    "main_activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Main scope of activity (companies only)."
                    },
                    "nationality_country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 4000
                    },
                    "allow_duplicate_name": {
                        "type": "boolean",
                        "description": "Create even if an active client with the same name exists.",
                        "default": false
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Client id. Use it as `client_id` elsewhere.",
                        "examples": [
                            512
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft."
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "True for a natural person, false for a company."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "archived": {
                        "type": "boolean"
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "mailing_address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "tax_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "company_registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_position": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "main_activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Main scope of activity. Companies only; null for a natural person."
                    },
                    "nationality_country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/clients",
                "args": {
                    "name": "body",
                    "is_person": "body",
                    "email": "body",
                    "phone": "body",
                    "address": "body",
                    "mailing_address": "body",
                    "tax_number": "body",
                    "company_registration_number": "body",
                    "representative_name": "body",
                    "representative_position": "body",
                    "main_activity": "body",
                    "nationality_country": "body",
                    "note": "body",
                    "allow_duplicate_name": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "clients_update",
            "capability": "clients.update",
            "title": "Update client",
            "description": "Changes a client's contact fields (name, email, phone, address, note, nationality, and company representative/activity). ID numbers, tax numbers, fees and the person/company type are not editable here. Pass expected_updated_at; a conflicting change answers 409.",
            "scope": "clients:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "Full name or company name. Plain text, at most 255 characters as a NEW value; \"<\" and \">\" cannot be introduced either, but a stored name that is longer or contains them may be sent back unchanged. null keeps the current name."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "address": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false,
                        "description": "Registered / home address."
                    },
                    "mailing_address": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "representative_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Companies only."
                    },
                    "representative_position": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Companies only."
                    },
                    "main_activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Main scope of activity (companies only)."
                    },
                    "nationality_country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text note, at most 4000 characters as a NEW value; a longer stored note may be sent back unchanged. null clears the note."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Client id. Use it as `client_id` elsewhere.",
                        "examples": [
                            512
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Kovács Kft."
                        ]
                    },
                    "is_person": {
                        "type": "boolean",
                        "description": "True for a natural person, false for a company."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "archived": {
                        "type": "boolean"
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    },
                    "address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "mailing_address": {
                        "type": "object",
                        "properties": {
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 20
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "street": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "tax_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "company_registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "representative_position": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Companies only; null for a natural person."
                    },
                    "main_activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Main scope of activity. Companies only; null for a natural person."
                    },
                    "nationality_country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/clients/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "name": "body",
                    "email": "body",
                    "phone": "body",
                    "address": "body",
                    "mailing_address": "body",
                    "representative_name": "body",
                    "representative_position": "body",
                    "main_activity": "body",
                    "nationality_country": "body",
                    "note": "body"
                }
            }
        },
        {
            "name": "tasks_list",
            "capability": "tasks.list",
            "title": "List tasks",
            "description": "Lists tasks (to-dos with a deadline) the user may see, soonest deadline first. Open tasks by default; filter by assignee, matter, client or deadline range. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "tasks:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed",
                            "all"
                        ],
                        "description": "open (default), closed or all.",
                        "default": "open"
                    },
                    "assigned_to_user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only tasks assigned to this user (a user id from colleagues.list)."
                    },
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only tasks of this matter."
                    },
                    "client_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only caseless tasks of this client."
                    },
                    "deadline_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Deadline on or after this date.",
                        "examples": [
                            "2026-11-01"
                        ]
                    },
                    "deadline_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Deadline on or before this date.",
                        "examples": [
                            "2026-11-30"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "priority": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "1 = low, 2 = medium, 3 = high; null = not set (an older task without a priority).",
                        "examples": [
                            2
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed"
                        ]
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the task was closed, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the task belongs to, if any."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client: the matter's first client, or the task's own client when it has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/tasks",
                "args": {
                    "status": "query",
                    "assigned_to_user_id": "query",
                    "matter_id": "query",
                    "client_id": "query",
                    "deadline_from": "query",
                    "deadline_to": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "tasks_get",
            "capability": "tasks.get",
            "title": "Get task",
            "description": "Returns one task. Answers 404 when the task does not exist or the user may not see it.",
            "scope": "tasks:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Task id.",
                        "examples": [
                            9876
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "priority": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "1 = low, 2 = medium, 3 = high; null = not set (an older task without a priority).",
                        "examples": [
                            2
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed"
                        ]
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the task was closed, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the task belongs to, if any."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client: the matter's first client, or the task's own client when it has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/tasks/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "tasks_create",
            "capability": "tasks.create",
            "title": "Create task",
            "description": "Creates a task (to-do with a deadline), either on a matter (`matter_id`, visible and not archived) or caseless, optionally for a client (`client_id`). The assignee defaults to the key's user and is notified when it is someone else.",
            "scope": "tasks:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "subject": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 2,
                        "description": "What has to be done. Plain text.",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "deadline": {
                        "type": "string",
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Matter the task belongs to. Omit for a caseless task.",
                        "examples": [
                            1234
                        ]
                    },
                    "client_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Client of a caseless task. Not allowed together with matter_id (a matter's task takes the matter's client)."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Colleague responsible for the task: a user id from colleagues.list (look a dictated name up there). Default: the user behind the key."
                    },
                    "priority": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 3,
                        "description": "1 = low, 2 = medium (default), 3 = high.",
                        "default": 2
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "description": "Longer details, plain text."
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Id of an office task flag (label)."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "subject",
                    "deadline"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "priority": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "1 = low, 2 = medium, 3 = high; null = not set (an older task without a priority).",
                        "examples": [
                            2
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed"
                        ]
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the task was closed, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the task belongs to, if any."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client: the matter's first client, or the task's own client when it has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/tasks",
                "args": {
                    "subject": "body",
                    "deadline": "body",
                    "matter_id": "body",
                    "client_id": "body",
                    "assigned_to_user_id": "body",
                    "priority": "body",
                    "description": "body",
                    "flag_id": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "tasks_update",
            "capability": "tasks.update",
            "title": "Update task",
            "description": "Changes a task: subject, deadline, description, priority, flag, assignee or the matter it belongs to. Moving it onto a matter re-derives the court link and drops a direct client; client_id is only for a caseless task. Pass expected_updated_at; a conflicting change answers 409.",
            "scope": "tasks:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "What has to be done. Plain text, at most 1000 characters as a NEW value; a longer stored subject may be sent back unchanged. null keeps the current subject."
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD. null keeps the current deadline (a deadline cannot be cleared)."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Move the task onto this matter (must be visible and not archived), or null to detach it. Sending the task's current matter changes nothing."
                    },
                    "client_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Client of a caseless task. Only allowed when the task has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "New assignee: an active colleague's user id from colleagues.list. Notified when it is not you. Sending the current one - or null / 0, which a task without an assignee reads back as - changes nothing."
                    },
                    "priority": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 3,
                        "description": "1 = low, 2 = medium, 3 = high. Omit it to keep the current priority (also when the task reads back with priority null); null is refused."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Longer details, plain text, at most 10000 characters as a NEW value; a longer stored description may be sent back unchanged."
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Id of an office task flag (label), or null to clear it."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "priority": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "1 = low, 2 = medium, 3 = high; null = not set (an older task without a priority).",
                        "examples": [
                            2
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed"
                        ]
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the task was closed, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the task belongs to, if any."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client: the matter's first client, or the task's own client when it has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/tasks/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "subject": "body",
                    "deadline": "body",
                    "matter_id": "body",
                    "client_id": "body",
                    "assigned_to_user_id": "body",
                    "priority": "body",
                    "description": "body",
                    "flag_id": "body"
                }
            }
        },
        {
            "name": "tasks_close",
            "capability": "tasks.close",
            "title": "Close task",
            "description": "Closes a task. If minutes are given it also books a time entry (needs workhours:create and a case: the task's own, or matter_id on a caseless task); billable minutes are clipped to the office hour-cap. A second close answers 409, so a retry never books a second entry.",
            "scope": "tasks:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Task id.",
                        "examples": [
                            9876
                        ]
                    },
                    "minutes_spent": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Time spent, in minutes. Booking any time needs the workhours:create scope and a case."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Billable minutes; clipped to the office hour-cap."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Normative minutes; stored raw, never capped."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Assign this case to a CASELESS task at close (and so make it possible to book time). Not allowed when the task already has a case."
                    },
                    "client_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Direct client (Megbízó) for a caseless task closed without a case."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "examples": [
                            "Submit the statement of defence"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "deadline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Due date, YYYY-MM-DD.",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "priority": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "1 = low, 2 = medium, 3 = high; null = not set (an older task without a priority).",
                        "examples": [
                            2
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "closed"
                        ]
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day the task was closed, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the task belongs to, if any."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client: the matter's first client, or the task's own client when it has no matter."
                    },
                    "assigned_to_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false
                    },
                    "booked_workhour": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer",
                                "minimum": 1
                            },
                            "minutes": {
                                "type": "integer"
                            },
                            "minutes_invoiceable": {
                                "type": "integer"
                            },
                            "minutes_normative": {
                                "type": "integer"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The time entry booked from the close, or null when no time was entered."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "POST",
                "path": "/tasks/{id}/close",
                "args": {
                    "id": "path",
                    "minutes_spent": "body",
                    "minutes_invoiceable": "body",
                    "minutes_normative": "body",
                    "matter_id": "body",
                    "client_id": "body"
                }
            }
        },
        {
            "name": "workhours_list",
            "capability": "workhours.list",
            "title": "List time entries",
            "description": "Lists live (not yet invoiced) time entries on matters the user may see, newest first. Filter by matter, responsible colleague or date range. Entries excluded from the summary are listed too, flagged excluded: true; leave them out of billable totals. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "workhours:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only entries on this matter.",
                        "examples": [
                            1234
                        ]
                    },
                    "responsible_user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only entries booked to this colleague (a user id from colleagues.list)."
                    },
                    "date_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only entries on or after this date (YYYY-MM-DD)."
                    },
                    "date_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only entries on or before this date (YYYY-MM-DD)."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Time entry id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the entry is booked to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "What was done (plain text)."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Minutes spent."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Billable minutes after the office hour-cap was applied (may be lower than requested). They count towards billing only while excluded is false."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Normative minutes (informational; never capped)."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Colleague the time is booked to."
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Who recorded the entry."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the entry is locked (read-only through the API)."
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the entry from the matter summary: it is not billed and its minutes are left out of the billable totals."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/workhours",
                "args": {
                    "matter_id": "query",
                    "responsible_user_id": "query",
                    "date_from": "query",
                    "date_to": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "workhours_get",
            "capability": "workhours.get",
            "title": "Get time entry",
            "description": "Returns one live time entry by id, if its matter is visible to the user.",
            "scope": "workhours:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Time entry id."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Time entry id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the entry is booked to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "What was done (plain text)."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Minutes spent."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Billable minutes after the office hour-cap was applied (may be lower than requested). They count towards billing only while excluded is false."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Normative minutes (informational; never capped)."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Colleague the time is booked to."
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Who recorded the entry."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the entry is locked (read-only through the API)."
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the entry from the matter summary: it is not billed and its minutes are left out of the billable totals."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/workhours/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "workhours_create",
            "capability": "workhours.create",
            "title": "Record time entry",
            "description": "Records a time entry on a matter: date, activity, minutes spent and billable minutes. Omitted billable minutes mean not billable: send minutes_invoiceable for billable work. They are clipped to the office hour-cap. The responsible colleague defaults to the key's user and is notified otherwise.",
            "scope": "workhours:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the time is booked to (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Date of the work, YYYY-MM-DD.",
                        "examples": [
                            "2026-10-30"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "What was done; the read side returns it as `activity` and either name is accepted here (one of the two is required). Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Drafting the statement of claim"
                        ]
                    },
                    "activity": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "The same field as `subject`, under the name the read side uses. Send one of the two."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Minutes actually spent.",
                        "examples": [
                            90
                        ]
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Billable minutes requested. Omitted or null = not billable (the entry bills nothing; they are not derived from minutes): for billable work send them explicitly, usually equal to minutes. The office hour-cap may reduce the stored value. They count towards billing only while the entry is not excluded from the summary.",
                        "examples": [
                            60
                        ]
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Normative minutes (informational; never capped)."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Colleague the time is booked to: a user id from colleagues.list (look a dictated name up there). Default: the user behind the key."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "matter_id",
                    "date"
                ],
                "anyOf": [
                    {
                        "required": [
                            "subject"
                        ]
                    },
                    {
                        "required": [
                            "activity"
                        ]
                    }
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Time entry id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the entry is booked to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "What was done (plain text)."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Minutes spent."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Billable minutes after the office hour-cap was applied (may be lower than requested). They count towards billing only while excluded is false."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Normative minutes (informational; never capped)."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Colleague the time is booked to."
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Who recorded the entry."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the entry is locked (read-only through the API)."
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the entry from the matter summary: it is not billed and its minutes are left out of the billable totals."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/workhours",
                "args": {
                    "matter_id": "body",
                    "date": "body",
                    "subject": "body",
                    "activity": "body",
                    "minutes": "body",
                    "minutes_invoiceable": "body",
                    "minutes_normative": "body",
                    "responsible_user_id": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "workhours_update",
            "capability": "workhours.update",
            "title": "Update time entry",
            "description": "Changes a live time entry: date, activity (`subject` or `activity`), minutes, billable minutes (a changed number is clipped to the hour-cap, an echoed one kept) and the responsible colleague. A locked or invoiced entry cannot be changed (409). Pass expected_updated_at; a conflict answers 409.",
            "scope": "workhours:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Date of the work, YYYY-MM-DD. null keeps the current date."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "What was done, the value the read side returns as `activity` (either name is accepted; null under one of them is \"not given\", only two different texts are refused). Plain text, at most 1000 characters as a NEW value; \"<\" and \">\" cannot be introduced either, but a stored text that is longer or contains them may be sent back unchanged. null keeps the current text."
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "The same field as `subject`, under the name the read side uses. Send one of the two (null under the other one is fine)."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Minutes actually spent; null clears them."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Billable minutes requested. A number different from the stored one is clipped to what is left of the hour-cap; re-sending the value the read returned keeps it as recorded (it is not clipped again). null clears them. They count towards billing only while the entry is not excluded from the summary (excluded is false)."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000,
                        "description": "Normative minutes (never capped); null clears them."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "New responsible colleague: an active colleague's user id from colleagues.list; notified when it is not you. Sending the current one - or null / 0, which an entry without a responsible reads back as - changes nothing."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Time entry id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the entry is booked to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "What was done (plain text)."
                    },
                    "minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Minutes spent."
                    },
                    "minutes_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Billable minutes after the office hour-cap was applied (may be lower than requested). They count towards billing only while excluded is false."
                    },
                    "minutes_normative": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Normative minutes (informational; never capped)."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Colleague the time is booked to."
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Who recorded the entry."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the entry is locked (read-only through the API)."
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the entry from the matter summary: it is not billed and its minutes are left out of the billable totals."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/workhours/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "date": "body",
                    "subject": "body",
                    "activity": "body",
                    "minutes": "body",
                    "minutes_invoiceable": "body",
                    "minutes_normative": "body",
                    "responsible_user_id": "body"
                }
            }
        },
        {
            "name": "costs_list",
            "capability": "costs.list",
            "title": "List costs",
            "description": "Lists the live costs of matters the user may see, newest first (an invoiced cost is no longer here). Filter by matter, responsible colleague or date range. Amounts are net. Rows flagged excluded: true are out of the summary and rows flagged locked: true are managed by Flowyer. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "costs:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only costs on this matter.",
                        "examples": [
                            1234
                        ]
                    },
                    "responsible_user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only costs recorded for this colleague (a user id from colleagues.list)."
                    },
                    "date_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only costs on or after this date (YYYY-MM-DD)."
                    },
                    "date_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only costs on or before this date (YYYY-MM-DD)."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Cost id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the cost belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Description of the cost (plain text)."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net cost amount (no VAT)."
                    },
                    "cost_invoiceable": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net amount to bill on to the client. It counts towards billing only while excluded is false."
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Currency id (Flowyer currency list)."
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Currency ISO code, e.g. HUF, EUR."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the cost from the matter summary: it is not billed and is left out of the billable totals."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the cost is managed by Flowyer - mirrored from an incoming invoice, or a disbursement surcharge - and cannot be changed through the API (costs.update answers 409 record_locked, details.reason says which)."
                    },
                    "approved_for_billing": {
                        "type": "boolean",
                        "description": "True when a colleague approved the cost for billing in the matter summary. It stays editable through the API (as in the web), and the approval is NOT re-requested afterwards: say so before changing the amount of an approved cost."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/costs",
                "args": {
                    "matter_id": "query",
                    "responsible_user_id": "query",
                    "date_from": "query",
                    "date_to": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "costs_get",
            "capability": "costs.get",
            "title": "Get cost",
            "description": "Returns one live cost by id, if its matter is visible to the user. Amounts are net.",
            "scope": "costs:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Cost id."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Cost id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the cost belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Description of the cost (plain text)."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net cost amount (no VAT)."
                    },
                    "cost_invoiceable": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net amount to bill on to the client. It counts towards billing only while excluded is false."
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Currency id (Flowyer currency list)."
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Currency ISO code, e.g. HUF, EUR."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the cost from the matter summary: it is not billed and is left out of the billable totals."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the cost is managed by Flowyer - mirrored from an incoming invoice, or a disbursement surcharge - and cannot be changed through the API (costs.update answers 409 record_locked, details.reason says which)."
                    },
                    "approved_for_billing": {
                        "type": "boolean",
                        "description": "True when a colleague approved the cost for billing in the matter summary. It stays editable through the API (as in the web), and the approval is NOT re-requested afterwards: say so before changing the amount of an approved cost."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/costs/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "costs_create",
            "capability": "costs.create",
            "title": "Record cost",
            "description": "Records a cost (disbursement) on a matter: date, text (`subject`, read back as `activity`), net amount, net amount billed to the client, and currency (default: the office currency). Amounts are net (no VAT). The responsible colleague defaults to the key's user and is notified otherwise.",
            "scope": "costs:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the cost belongs to (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Date of the cost, YYYY-MM-DD.",
                        "examples": [
                            "2026-10-30"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "Description of the cost; the read side returns it as `activity` and either name is accepted here (one of the two is required). Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Court filing fee"
                        ]
                    },
                    "activity": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 2,
                        "pattern": "^[^<>]*$",
                        "description": "The same field as `subject`, under the name the read side uses. Send one of the two."
                    },
                    "cost": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2147483647,
                        "description": "Net cost amount (no VAT), a whole number in the currency's main unit (cents are not stored).",
                        "examples": [
                            15000
                        ]
                    },
                    "cost_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 2147483647,
                        "description": "Net amount to bill on to the client, a whole number (omit if not billed). It counts towards billing only while the cost is not excluded from the summary.",
                        "examples": [
                            15000
                        ]
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Currency id from the Flowyer currency list (not an ISO code). Omit it to use the office currency (GET /me `office.currency_id` / `office.currency`); an unknown id answers 422 with the accepted ids and codes in details.allowed."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Responsible colleague: a user id from colleagues.list (look a dictated name up there). Default: the user behind the key."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "matter_id",
                    "date",
                    "cost"
                ],
                "anyOf": [
                    {
                        "required": [
                            "subject"
                        ]
                    },
                    {
                        "required": [
                            "activity"
                        ]
                    }
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Cost id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the cost belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Description of the cost (plain text)."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net cost amount (no VAT)."
                    },
                    "cost_invoiceable": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net amount to bill on to the client. It counts towards billing only while excluded is false."
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Currency id (Flowyer currency list)."
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Currency ISO code, e.g. HUF, EUR."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the cost from the matter summary: it is not billed and is left out of the billable totals."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the cost is managed by Flowyer - mirrored from an incoming invoice, or a disbursement surcharge - and cannot be changed through the API (costs.update answers 409 record_locked, details.reason says which)."
                    },
                    "approved_for_billing": {
                        "type": "boolean",
                        "description": "True when a colleague approved the cost for billing in the matter summary. It stays editable through the API (as in the web), and the approval is NOT re-requested afterwards: say so before changing the amount of an approved cost."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/costs",
                "args": {
                    "matter_id": "body",
                    "date": "body",
                    "subject": "body",
                    "activity": "body",
                    "cost": "body",
                    "cost_invoiceable": "body",
                    "currency_id": "body",
                    "responsible_user_id": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "costs_update",
            "capability": "costs.update",
            "title": "Update cost",
            "description": "Changes a live cost: text (`subject`, read back as `activity`), date, net amounts, currency and the responsible colleague. A cost flagged locked: true cannot be changed (409 record_locked, details.reason). Pass expected_updated_at; a conflicting change answers 409.",
            "scope": "costs:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Date of the cost, YYYY-MM-DD. null keeps the current date."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "Description of the cost, the value the read side returns as `activity` (either name is accepted; null under one of them is \"not given\", only two different texts are refused). Plain text, at most 1000 characters as a NEW value; \"<\" and \">\" cannot be introduced either, but a stored text that is longer or contains them may be sent back unchanged. null keeps the current text."
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "The same field as `subject`, under the name the read side uses. Send one of the two (null under the other one is fine)."
                    },
                    "cost": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 2147483647,
                        "description": "Net cost amount (no VAT), a whole number in the currency's main unit (cents are not stored). null clears the amount."
                    },
                    "cost_invoiceable": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 2147483647,
                        "description": "Net amount to bill on to the client, a whole number; null clears it. It counts towards billing only while the cost is not excluded from the summary (excluded is false)."
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "Currency id from the Flowyer currency list (not an ISO code; the office currency is GET /me `office.currency_id`). An unknown id answers 422 with the accepted ids and codes in details.allowed. null - or the 0 an unset legacy cost reads back as - keeps the current currency."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "New responsible colleague: an active colleague's user id from colleagues.list. Sending the current one - or null / 0, which a cost without a responsible reads back as - changes nothing."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Cost id."
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Matter the cost belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "activity": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Description of the cost (plain text)."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net cost amount (no VAT)."
                    },
                    "cost_invoiceable": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Net amount to bill on to the client. It counts towards billing only while excluded is false."
                    },
                    "currency_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Currency id (Flowyer currency list)."
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Currency ISO code, e.g. HUF, EUR."
                    },
                    "responsible_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "responsible": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "excluded": {
                        "type": "boolean",
                        "description": "True when a colleague excluded the cost from the matter summary: it is not billed and is left out of the billable totals."
                    },
                    "locked": {
                        "type": "boolean",
                        "description": "True when the cost is managed by Flowyer - mirrored from an incoming invoice, or a disbursement surcharge - and cannot be changed through the API (costs.update answers 409 record_locked, details.reason says which)."
                    },
                    "approved_for_billing": {
                        "type": "boolean",
                        "description": "True when a colleague approved the cost for billing in the matter summary. It stays editable through the API (as in the web), and the approval is NOT re-requested afterwards: say so before changing the amount of an approved cost."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Send this back as expected_updated_at when updating."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/costs/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "date": "body",
                    "subject": "body",
                    "activity": "body",
                    "cost": "body",
                    "cost_invoiceable": "body",
                    "currency_id": "body",
                    "responsible_user_id": "body"
                }
            }
        },
        {
            "name": "invoices_list",
            "capability": "invoices.list",
            "title": "List invoices",
            "description": "Lists invoices (issued and received), newest issue date first. direction=outgoing is the office's issued-invoice list and leaves proformas out (direction=proforma lists those). Read-only: invoices cannot be created or changed through the API. Invoices of matters the user may not see are hidden. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "invoices:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing",
                            "proforma"
                        ],
                        "description": "The office's own three lists: outgoing = invoices issued by the office, proformas excluded (a legacy row with no document type counts as an invoice, as in the office dashboard); proforma = payment requests (díjbekérő) issued by the office; incoming = received."
                    },
                    "paid_status": {
                        "type": "string",
                        "enum": [
                            "unpaid",
                            "paid",
                            "partially_paid",
                            "cancelled"
                        ]
                    },
                    "client_id": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "issued_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Issue date on or after.",
                        "examples": [
                            "2026-01-01"
                        ]
                    },
                    "issued_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Issue date on or before.",
                        "examples": [
                            "2026-12-31"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            301
                        ]
                    },
                    "invoice_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "examples": [
                            "FLW-2026-0042"
                        ]
                    },
                    "direction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "incoming",
                            "outgoing",
                            null
                        ],
                        "description": "outgoing = issued by the office, incoming = received by the office."
                    },
                    "document_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "invoice",
                            "proforma",
                            "receipt",
                            null
                        ],
                        "description": "\"proforma\" is a request for payment, not an issued invoice: it is not revenue and must not be counted with the issued ones. invoices.list direction=outgoing leaves proformas out, direction=proforma lists them. Null on a legacy row, which counts as an invoice."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "manual",
                            "szamlazz_outgoing",
                            "szamlazz_imported",
                            null
                        ]
                    },
                    "paid_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "unpaid",
                            "paid",
                            "partially_paid",
                            "cancelled",
                            null
                        ]
                    },
                    "issued_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "paid_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "completion_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "net_amount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "gross_amount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "examples": [
                            "HUF"
                        ]
                    },
                    "payment_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "payment_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the payment method (e.g. bank transfer); English when the office language has no translation for it, null when the method has no name at all. Identify the method by payment_method_id."
                    },
                    "supplier": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Issuer of an incoming invoice."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/invoices",
                "args": {
                    "direction": "query",
                    "paid_status": "query",
                    "client_id": "query",
                    "matter_id": "query",
                    "issued_from": "query",
                    "issued_to": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "invoices_get",
            "capability": "invoices.get",
            "title": "Get invoice",
            "description": "Returns one invoice. Read-only. Answers 404 when it does not exist or belongs to a matter the user may not see.",
            "scope": "invoices:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Invoice id.",
                        "examples": [
                            301
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            301
                        ]
                    },
                    "invoice_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "examples": [
                            "FLW-2026-0042"
                        ]
                    },
                    "direction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "incoming",
                            "outgoing",
                            null
                        ],
                        "description": "outgoing = issued by the office, incoming = received by the office."
                    },
                    "document_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "invoice",
                            "proforma",
                            "receipt",
                            null
                        ],
                        "description": "\"proforma\" is a request for payment, not an issued invoice: it is not revenue and must not be counted with the issued ones. invoices.list direction=outgoing leaves proformas out, direction=proforma lists them. Null on a legacy row, which counts as an invoice."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "manual",
                            "szamlazz_outgoing",
                            "szamlazz_imported",
                            null
                        ]
                    },
                    "paid_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "unpaid",
                            "paid",
                            "partially_paid",
                            "cancelled",
                            null
                        ]
                    },
                    "issued_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "due_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "paid_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "completion_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "net_amount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "gross_amount": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "examples": [
                            "HUF"
                        ]
                    },
                    "payment_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "payment_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized name of the payment method (e.g. bank transfer); English when the office language has no translation for it, null when the method has no name at all. Identify the method by payment_method_id."
                    },
                    "supplier": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Issuer of an incoming invoice."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false
                    },
                    "matter_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "received_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "sent_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "proforma_invoice_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/invoices/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "documents_list",
            "capability": "documents.list",
            "title": "List matter documents",
            "description": "Lists the current versions of the documents filed under a matter: names, sizes, folders and who uploaded them. Metadata only; use documents.download (scope documents:download) for a signed link to the contents. Named documents come first, alphabetically, then imported ones that carry no name. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "documents:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Filter by file name.",
                        "examples": [
                            "contract"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string",
                        "description": "File name as shown in Flowyer: the name stored with the document, or its storage name when it was imported from an older system without one. documents.list is ordered by the stored name: documents that have one come first, alphabetically, then the imported ones without a stored name, oldest first (the order they were filed in Flowyer), which are therefore not sorted by the name shown here. The order is the same on every page, so limit and offset page through the list without repeats or gaps.",
                        "examples": [
                            "Contract_v2.docx"
                        ]
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes."
                    },
                    "version": {
                        "type": "integer",
                        "description": "Current version number of the file."
                    },
                    "folder": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "path": {
                                "type": "string",
                                "description": "Folder path inside the matter, \"/\" separated."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The folder the document is filed in, or null at the matter root. documents.upload.complete answers null when the folder chosen at documents.upload.init was deleted while the bytes were uploading: the document is then filed at the matter root, which is where Flowyer shows it. If the root already holds a document of that name, the upload is filed under a suffixed name (\"Contract_2.pdf\") instead of becoming a new version of that unrelated document; the 201 echoes the stored `name`."
                    },
                    "folder_deleted": {
                        "type": "boolean",
                        "description": "True when the document is filed in a folder that no longer exists, which Flowyer's own file list does not show (`folder` is null for it, as it is for a document at the matter root). documents.upload.complete answers true only if the folder was deleted while the bytes were uploading AND moving the stored file to the matter root failed: the document is then kept in the deleted folder, where its contents are still reachable. False for everything else, a normal root filing included."
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/documents",
                "args": {
                    "id": "path",
                    "q": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "documents_folders",
            "capability": "documents.folders",
            "title": "List matter folders",
            "description": "Lists every folder of a matter, empty ones included: id, name, parent_id and the \"/\"-separated path, ordered by path. Pass a folder id as folder_id to documents.upload.init. Answers 404 when the matter is not visible to the user. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "documents:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Only folders whose path contains this text (case and accents ignored), e.g. a folder name.",
                        "examples": [
                            "Beadványok"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Folder id: pass it as folder_id to documents.upload.init."
                    },
                    "name": {
                        "type": "string",
                        "description": "Folder name as shown in Flowyer."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the parent folder; null for a folder at the matter root."
                    },
                    "path": {
                        "type": "string",
                        "description": "Folder path inside the matter, \"/\" separated, e.g. \"/Iratok/Beadványok\" (the same path documents.list shows for a file's folder)."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to documents.folders.rename as expected_updated_at."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/folders",
                "args": {
                    "id": "path",
                    "q": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "documents_folders_create",
            "capability": "documents.folders.create",
            "title": "Create matter folder",
            "description": "Creates a folder in a matter, at the root or under parent_id (a folder of the SAME matter). The name is plain text (\"<\" and \">\" are not allowed). File a document into it by passing the returned id as folder_id to documents.upload.init. Answers 404 when the matter is not visible.",
            "scope": "documents:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the folder belongs to (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "Folder name, at most 255 characters. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Beadványok"
                        ]
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Parent folder id (from documents.folders) inside the SAME matter; omit for a folder at the matter root."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Folder id: pass it as folder_id to documents.upload.init, or as parent_id to documents.folders.create."
                    },
                    "name": {
                        "type": "string",
                        "description": "Folder name as shown in Flowyer."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the parent folder; null for a folder at the matter root."
                    },
                    "path": {
                        "type": "string",
                        "description": "Folder path inside the matter, \"/\" separated, e.g. \"/Iratok/Beadványok\"."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to documents.folders.rename as expected_updated_at."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/folders",
                "args": {
                    "id": "path",
                    "name": "body",
                    "parent_id": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "documents_upload_init",
            "capability": "documents.upload.init",
            "title": "Start document upload",
            "description": "Starts a document upload: returns a signed upload_url and an upload_token. PUT the bytes there, then call documents.upload.complete. The PUT is a plain HTTPS request outside this API and outside MCP tools: an assistant without its own HTTP client should ask the user to upload the file in Flowyer.",
            "scope": "documents:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the document belongs to (must be visible)."
                    },
                    "filename": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "File name with extension, e.g. \"Contract.pdf\". Plain text; \"<\" and \">\" are not allowed. Executable and web file types are refused (422 blocked_file_type).",
                        "examples": [
                            "Contract.pdf"
                        ]
                    },
                    "content_type": {
                        "type": "string",
                        "maxLength": 100,
                        "minLength": 1,
                        "description": "MIME type sent on the PUT, e.g. \"application/pdf\". It is part of the signature and must match exactly.",
                        "examples": [
                            "application/pdf"
                        ]
                    },
                    "size": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "File size in bytes, at most 104857600 (the upload limit); a larger size answers 413 `file_too_large`.",
                        "examples": [
                            248000
                        ]
                    },
                    "folder_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Folder inside the matter: a folder id from documents.folders (it lists empty folders too). Omit for the matter root."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "filename",
                    "content_type",
                    "size"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "upload_url": {
                        "type": "string",
                        "description": "Signed URL. PUT the file bytes here with the given content type AND the if_generation_match header below: a plain HTTPS request made by your own HTTP client (no API or MCP tool sends it)."
                    },
                    "upload_token": {
                        "type": "string",
                        "description": "Pass this to documents.upload.complete after the PUT succeeds."
                    },
                    "content_type": {
                        "type": "string",
                        "description": "Send exactly this Content-Type on the PUT."
                    },
                    "if_generation_match": {
                        "type": "string",
                        "description": "Send this value as the \"x-goog-if-generation-match\" header on the PUT (always \"0\"). It makes the upload single-use: the PUT is accepted only while the object does not yet exist, so the signed URL cannot overwrite an already-filed document."
                    },
                    "object_key": {
                        "type": "string",
                        "description": "Internal storage name (for reference)."
                    },
                    "expires_in": {
                        "type": "integer",
                        "description": "Seconds until the upload URL and token expire."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/documents/uploads",
                "args": {
                    "id": "path",
                    "filename": "body",
                    "content_type": "body",
                    "size": "body",
                    "folder_id": "body"
                }
            }
        },
        {
            "name": "documents_upload_complete",
            "capability": "documents.upload.complete",
            "title": "Finish document upload",
            "description": "Finishes a document upload: after the bytes were PUT to the upload_url, records the file on the matter as a new version. Pass the upload_token from documents.upload.init. The file metadata is taken from the token, not from this request. A folder deleted meanwhile files the document at the root.",
            "scope": "documents:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the document belongs to (same as in init)."
                    },
                    "upload_token": {
                        "type": "string",
                        "maxLength": 4096,
                        "minLength": 1,
                        "description": "The token returned by documents.upload.init."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "upload_token"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string",
                        "description": "File name as shown in Flowyer: the name stored with the document, or its storage name when it was imported from an older system without one. documents.list is ordered by the stored name: documents that have one come first, alphabetically, then the imported ones without a stored name, oldest first (the order they were filed in Flowyer), which are therefore not sorted by the name shown here. The order is the same on every page, so limit and offset page through the list without repeats or gaps.",
                        "examples": [
                            "Contract_v2.docx"
                        ]
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes."
                    },
                    "version": {
                        "type": "integer",
                        "description": "Current version number of the file."
                    },
                    "folder": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "path": {
                                "type": "string",
                                "description": "Folder path inside the matter, \"/\" separated."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The folder the document is filed in, or null at the matter root. documents.upload.complete answers null when the folder chosen at documents.upload.init was deleted while the bytes were uploading: the document is then filed at the matter root, which is where Flowyer shows it. If the root already holds a document of that name, the upload is filed under a suffixed name (\"Contract_2.pdf\") instead of becoming a new version of that unrelated document; the 201 echoes the stored `name`."
                    },
                    "folder_deleted": {
                        "type": "boolean",
                        "description": "True when the document is filed in a folder that no longer exists, which Flowyer's own file list does not show (`folder` is null for it, as it is for a document at the matter root). documents.upload.complete answers true only if the folder was deleted while the bytes were uploading AND moving the stored file to the matter root failed: the document is then kept in the deleted folder, where its contents are still reachable. False for everything else, a normal root filing included."
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/documents",
                "args": {
                    "id": "path",
                    "upload_token": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "documents_download",
            "capability": "documents.download",
            "title": "Download document",
            "description": "Returns a short-lived signed URL to download one document by id, if its matter is visible. GET the url to fetch the bytes; it expires in a few minutes.",
            "scope": "documents:download",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Document id (from documents.list)."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "download_url": {
                        "type": "string",
                        "description": "Signed URL. GET it to download the file bytes."
                    },
                    "filename": {
                        "type": "string",
                        "description": "File name for the download."
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes."
                    },
                    "expires_in": {
                        "type": "integer",
                        "description": "Seconds until the URL expires."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/documents/{id}/download",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "documents_rename",
            "capability": "documents.rename",
            "title": "Rename document",
            "description": "Renames a document (its display name only; the file content is unchanged). The new name must be unique in the same folder of the matter. Pass expected_updated_at from your last read; a conflicting change answers 409.",
            "scope": "documents:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "New file name, at most 255 characters INCLUDING the extension. The current extension is kept if you omit one, and it counts towards the 255 (so an extension-less name for \"Beadvany.pdf\" may be at most 251 characters). Plain text; \"<\" and \">\" are not allowed, so a document whose stored name contains one can only be renamed in Flowyer.",
                        "examples": [
                            "Contract_signed.pdf"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string",
                        "description": "File name as shown in Flowyer: the name stored with the document, or its storage name when it was imported from an older system without one. documents.list is ordered by the stored name: documents that have one come first, alphabetically, then the imported ones without a stored name, oldest first (the order they were filed in Flowyer), which are therefore not sorted by the name shown here. The order is the same on every page, so limit and offset page through the list without repeats or gaps.",
                        "examples": [
                            "Contract_v2.docx"
                        ]
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes."
                    },
                    "version": {
                        "type": "integer",
                        "description": "Current version number of the file."
                    },
                    "folder": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "path": {
                                "type": "string",
                                "description": "Folder path inside the matter, \"/\" separated."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The folder the document is filed in, or null at the matter root. documents.upload.complete answers null when the folder chosen at documents.upload.init was deleted while the bytes were uploading: the document is then filed at the matter root, which is where Flowyer shows it. If the root already holds a document of that name, the upload is filed under a suffixed name (\"Contract_2.pdf\") instead of becoming a new version of that unrelated document; the 201 echoes the stored `name`."
                    },
                    "folder_deleted": {
                        "type": "boolean",
                        "description": "True when the document is filed in a folder that no longer exists, which Flowyer's own file list does not show (`folder` is null for it, as it is for a document at the matter root). documents.upload.complete answers true only if the folder was deleted while the bytes were uploading AND moving the stored file to the matter root failed: the document is then kept in the deleted folder, where its contents are still reachable. False for everything else, a normal root filing included."
                    },
                    "created_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/documents/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "name": "body"
                }
            }
        },
        {
            "name": "documents_folders_rename",
            "capability": "documents.folders.rename",
            "title": "Rename matter folder",
            "description": "Renames a folder (its name only; its files and subfolders keep their place). The name is plain text (\"<\" and \">\" are not allowed). Pass expected_updated_at from your last read (documents.folders lists it); a conflicting change answers 409.",
            "scope": "documents:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "New folder name, at most 255 characters. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Beadványok"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Folder id: pass it as folder_id to documents.upload.init, or as parent_id to documents.folders.create."
                    },
                    "name": {
                        "type": "string",
                        "description": "Folder name as shown in Flowyer."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the parent folder; null for a folder at the matter root."
                    },
                    "path": {
                        "type": "string",
                        "description": "Folder path inside the matter, \"/\" separated, e.g. \"/Iratok/Beadványok\"."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to documents.folders.rename as expected_updated_at."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/folders/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "name": "body"
                }
            }
        },
        {
            "name": "knowledge_articles_list",
            "capability": "knowledge.articles.list",
            "title": "List knowledge base articles",
            "description": "Lists knowledge-base articles the user may see (the author's own, global articles, and articles shared with the user's role). All statuses by default; filter by status, or pass `q` to full-text search titles, excerpts, content and tags. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "knowledge:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "q": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Full-text search term (titles, excerpts, content and tag names). Boolean operators are stripped.",
                        "examples": [
                            "felmondási idő"
                        ]
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "draft",
                            "published",
                            "archived",
                            null
                        ],
                        "description": "Only articles with this status. Omit to list every status."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "Server-generated URL slug.",
                        "examples": [
                            "felmondasi-ido"
                        ]
                    },
                    "title": {
                        "type": "string",
                        "examples": [
                            "Felmondási idő a munka törvénykönyvében"
                        ]
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (rich HTML, as stored). Use knowledge.articles.get for the full body."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ]
                    },
                    "is_featured": {
                        "type": "boolean",
                        "description": "Whether the article is pinned to the KB home page (not settable through the API)."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "category_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the author; 0 for a global (default) article."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the last editor, or null if never edited."
                    },
                    "editor_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "views_count": {
                        "type": "integer"
                    },
                    "downloads_count": {
                        "type": "integer"
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Role ids the article is shared with (empty = only the author/global)."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Tag names on the article."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the article was first published, or null."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/knowledge/articles",
                "args": {
                    "q": "query",
                    "status": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "knowledge_articles_get",
            "capability": "knowledge.articles.get",
            "title": "Get knowledge base article",
            "description": "Returns one knowledge-base article, including its full content, tags and shared roles. Answers 404 when the article does not exist or the user may not see it.",
            "scope": "knowledge:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Article id.",
                        "examples": [
                            9876
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "Server-generated URL slug.",
                        "examples": [
                            "felmondasi-ido"
                        ]
                    },
                    "title": {
                        "type": "string",
                        "examples": [
                            "Felmondási idő a munka törvénykönyvében"
                        ]
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (rich HTML, as stored). Use knowledge.articles.get for the full body."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ]
                    },
                    "is_featured": {
                        "type": "boolean",
                        "description": "Whether the article is pinned to the KB home page (not settable through the API)."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "category_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the author; 0 for a global (default) article."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the last editor, or null if never edited."
                    },
                    "editor_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "views_count": {
                        "type": "integer"
                    },
                    "downloads_count": {
                        "type": "integer"
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Role ids the article is shared with (empty = only the author/global)."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Tag names on the article."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the article was first published, or null."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "content": {
                        "type": "string",
                        "description": "The full article body as stored (rich HTML)."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/knowledge/articles/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "knowledge_articles_create",
            "capability": "knowledge.articles.create",
            "title": "Create knowledge base article",
            "description": "Creates a knowledge-base article authored by the key's user. The slug is generated from the title. The category must exist and be active. Share it with roles via `shared_roles` (otherwise only the author sees it). `content` and `excerpt` are HTML and are sanitised server-side.",
            "scope": "knowledge:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 500,
                        "description": "Article title. Plain text.",
                        "examples": [
                            "Felmondási idő a munka törvénykönyvében"
                        ]
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (HTML allowed, sanitised server-side), at most 200 characters."
                    },
                    "content": {
                        "type": "string",
                        "description": "The article body. Rich HTML, sanitised server-side with the knowledge-base profile."
                    },
                    "category_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of an existing, active knowledge-base category.",
                        "examples": [
                            12
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ],
                        "description": "draft, published or archived. published stamps published_at."
                    },
                    "tags": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "description": "Tag names; new tags are created as needed."
                    },
                    "shared_roles": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids to share the article with. Empty means only the author can see it."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "title",
                    "content",
                    "category_id",
                    "status"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "Server-generated URL slug.",
                        "examples": [
                            "felmondasi-ido"
                        ]
                    },
                    "title": {
                        "type": "string",
                        "examples": [
                            "Felmondási idő a munka törvénykönyvében"
                        ]
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (rich HTML, as stored). Use knowledge.articles.get for the full body."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ]
                    },
                    "is_featured": {
                        "type": "boolean",
                        "description": "Whether the article is pinned to the KB home page (not settable through the API)."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "category_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the author; 0 for a global (default) article."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the last editor, or null if never edited."
                    },
                    "editor_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "views_count": {
                        "type": "integer"
                    },
                    "downloads_count": {
                        "type": "integer"
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Role ids the article is shared with (empty = only the author/global)."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Tag names on the article."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the article was first published, or null."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "content": {
                        "type": "string",
                        "description": "The full article body as stored (rich HTML)."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/knowledge/articles",
                "args": {
                    "title": "body",
                    "excerpt": "body",
                    "content": "body",
                    "category_id": "body",
                    "status": "body",
                    "tags": "body",
                    "shared_roles": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "knowledge_articles_update",
            "capability": "knowledge.articles.update",
            "title": "Update knowledge base article",
            "description": "Changes a knowledge-base article: title (the slug is re-derived), excerpt, content, category, status, tags or shared roles. Only the author (or anyone, for a global article) may edit. Pass expected_updated_at; a conflicting change answers 409. content and excerpt are sanitised server-side.",
            "scope": "knowledge:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Article title (plain text). null keeps the current title; a new title re-derives the slug."
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (HTML allowed, sanitised), at most 200 characters as a NEW value. Empty/null clears it; omit to keep it."
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The article body (rich HTML, sanitised). null keeps the current content; it cannot be cleared."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Move the article to this existing, active category. null keeps the current one."
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "draft",
                            "published",
                            "archived",
                            null
                        ],
                        "description": "draft, published or archived. The first switch to published stamps published_at; it is never cleared. null keeps the current status."
                    },
                    "tags": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "description": "Replaces the whole tag set (new tags are created). An empty array clears all tags; omit to keep them."
                    },
                    "shared_roles": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Replaces the whole shared-role set. An empty array removes all sharing (only the author sees it); omit to keep it."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "Server-generated URL slug.",
                        "examples": [
                            "felmondasi-ido"
                        ]
                    },
                    "title": {
                        "type": "string",
                        "examples": [
                            "Felmondási idő a munka törvénykönyvében"
                        ]
                    },
                    "excerpt": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Short summary (rich HTML, as stored). Use knowledge.articles.get for the full body."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ]
                    },
                    "is_featured": {
                        "type": "boolean",
                        "description": "Whether the article is pinned to the KB home page (not settable through the API)."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "category_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the author; 0 for a global (default) article."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the last editor, or null if never edited."
                    },
                    "editor_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "views_count": {
                        "type": "integer"
                    },
                    "downloads_count": {
                        "type": "integer"
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Role ids the article is shared with (empty = only the author/global)."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Tag names on the article."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the article was first published, or null."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "content": {
                        "type": "string",
                        "description": "The full article body as stored (rich HTML)."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/knowledge/articles/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "title": "body",
                    "excerpt": "body",
                    "content": "body",
                    "category_id": "body",
                    "status": "body",
                    "tags": "body",
                    "shared_roles": "body"
                }
            }
        },
        {
            "name": "knowledge_categories_list",
            "capability": "knowledge.categories.list",
            "title": "List knowledge base categories",
            "description": "Lists the knowledge base categories the user may see: built-in default categories, the user's own, and those shared with the user's role. Ordered as in Flowyer (sort position, then name). Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "knowledge:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            42
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "URL slug, generated from the name.",
                        "examples": [
                            "munkajog"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Munkajog"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Plain-text description, or null."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Icon identifier shown next to the category, or null."
                    },
                    "order_column": {
                        "type": "integer",
                        "description": "Sort position among sibling categories.",
                        "examples": [
                            0
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Parent category id, or null for a root category."
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the creator; 0 for a built-in default category visible to everyone."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the creator, or null for a default category."
                    },
                    "articles_count": {
                        "type": "integer",
                        "description": "Number of published articles in this category that the caller may see."
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids this category is shared with. Empty means only the author sees it (a default category with author_id 0 is visible to everyone)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/knowledge/categories",
                "args": {
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "knowledge_categories_get",
            "capability": "knowledge.categories.get",
            "title": "Get knowledge base category",
            "description": "Returns one knowledge base category. Answers 404 when the category does not exist or is not visible to the user who owns this API key.",
            "scope": "knowledge:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Category id.",
                        "examples": [
                            42
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            42
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "URL slug, generated from the name.",
                        "examples": [
                            "munkajog"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Munkajog"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Plain-text description, or null."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Icon identifier shown next to the category, or null."
                    },
                    "order_column": {
                        "type": "integer",
                        "description": "Sort position among sibling categories.",
                        "examples": [
                            0
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Parent category id, or null for a root category."
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the creator; 0 for a built-in default category visible to everyone."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the creator, or null for a default category."
                    },
                    "articles_count": {
                        "type": "integer",
                        "description": "Number of published articles in this category that the caller may see."
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids this category is shared with. Empty means only the author sees it (a default category with author_id 0 is visible to everyone)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/knowledge/categories/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "knowledge_categories_create",
            "capability": "knowledge.categories.create",
            "title": "Create knowledge base category",
            "description": "Creates a knowledge base category. The URL slug is generated from the name. Share it with roles via shared_roles, or omit them so only you (the author) can see it. A parent_id, when given, must be an existing active category.",
            "scope": "knowledge:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Category name. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Munkajog"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional description, plain text."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Parent category id (must exist and be active). Omit for a root category."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "pattern": "^[^<>]*$",
                        "description": "Optional icon identifier. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "is_active": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the category is active. Default true.",
                        "default": true
                    },
                    "order_column": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "Sort position among sibling categories. Default 0.",
                        "examples": [
                            0
                        ]
                    },
                    "shared_roles": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids to share this category with. Omit so only you (the author) can see it."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            42
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "URL slug, generated from the name.",
                        "examples": [
                            "munkajog"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Munkajog"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Plain-text description, or null."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Icon identifier shown next to the category, or null."
                    },
                    "order_column": {
                        "type": "integer",
                        "description": "Sort position among sibling categories.",
                        "examples": [
                            0
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Parent category id, or null for a root category."
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the creator; 0 for a built-in default category visible to everyone."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the creator, or null for a default category."
                    },
                    "articles_count": {
                        "type": "integer",
                        "description": "Number of published articles in this category that the caller may see."
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids this category is shared with. Empty means only the author sees it (a default category with author_id 0 is visible to everyone)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/knowledge/categories",
                "args": {
                    "name": "body",
                    "description": "body",
                    "parent_id": "body",
                    "icon": "body",
                    "is_active": "body",
                    "order_column": "body",
                    "shared_roles": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "knowledge_categories_update",
            "capability": "knowledge.categories.update",
            "title": "Update knowledge base category",
            "description": "Changes a knowledge base category: name (the slug follows), description, icon, parent, active flag, sort position or the roles it is shared with. Only the author may change it (a built-in default category is editable by anyone). Pass expected_updated_at; a conflicting change answers 409.",
            "scope": "knowledge:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "description": "Category name. At most 255 characters as a NEW value; \"<\" and \">\" cannot be introduced, but a stored name that is longer or contains them may be sent back unchanged. null keeps the current name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Plain-text description. null clears it."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Move the category under this parent (must exist, be active and not create a cycle), or null to make it a root category."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Icon identifier. At most 100 characters as a NEW value; \"<\" and \">\" cannot be introduced. null clears it."
                    },
                    "is_active": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Active flag. Omit or null to keep the current value."
                    },
                    "order_column": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "description": "Sort position among sibling categories. Omit or null to keep the current value."
                    },
                    "shared_roles": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Replace the set of role ids this category is shared with. An empty array removes all sharing (only the author sees it). Omit to leave sharing unchanged."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            42
                        ]
                    },
                    "slug": {
                        "type": "string",
                        "description": "URL slug, generated from the name.",
                        "examples": [
                            "munkajog"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "examples": [
                            "Munkajog"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Plain-text description, or null."
                    },
                    "icon": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Icon identifier shown next to the category, or null."
                    },
                    "order_column": {
                        "type": "integer",
                        "description": "Sort position among sibling categories.",
                        "examples": [
                            0
                        ]
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Parent category id, or null for a root category."
                    },
                    "author_id": {
                        "type": "integer",
                        "description": "User id of the creator; 0 for a built-in default category visible to everyone."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the creator, or null for a default category."
                    },
                    "articles_count": {
                        "type": "integer",
                        "description": "Number of published articles in this category that the caller may see."
                    },
                    "shared_roles": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Role ids this category is shared with. Empty means only the author sees it (a default category with author_id 0 is visible to everyone)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/knowledge/categories/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "name": "body",
                    "description": "body",
                    "parent_id": "body",
                    "icon": "body",
                    "is_active": "body",
                    "order_column": "body",
                    "shared_roles": "body"
                }
            }
        },
        {
            "name": "emails_list",
            "capability": "emails.list",
            "title": "List matter emails",
            "description": "Lists the emails saved onto a matter: sender name and address, subject, size and the colleague who saved each one, newest sent first. Header and metadata only, never the body or the raw HTML. Use emails.get for a single message's plain-text body. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "emails:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Filter by subject, sender name or sender address (accent- and case-insensitive). Not the body.",
                        "examples": [
                            "invoice"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Email id (use with emails.get).",
                        "examples": [
                            1234
                        ]
                    },
                    "from_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the outside party. The store keeps no direction or recipient columns, so this is always the external party, never a colleague, and the API cannot say whether the mail was incoming or outgoing."
                    },
                    "from_address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "SMTP address of the outside party."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the message was sent. The stored value's timezone is inconsistent by ingest path (the IMAP worker stores UTC, the Outlook add-in stores an office-zone wall time), so it is best-effort and the list order by it can be off by the office UTC offset across sources. created_at is the reliable timestamp."
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes of the stored .eml/.msg file."
                    },
                    "extension": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "\"msg\" (Outlook add-in) or \"eml\" (IMAP / default); null on some legacy rows."
                    },
                    "saved_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the colleague who saved the mail into Flowyer."
                    },
                    "saved_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of that colleague."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the mail was saved into Flowyer (office-zone wall time). The reliable timestamp for stable pagination."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/emails",
                "args": {
                    "id": "path",
                    "q": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "emails_get",
            "capability": "emails.get",
            "title": "Get email",
            "description": "Returns one saved email of a matter with its plain-text body (sender, subject, size and who saved it). The raw HTML body is never returned. Answers 404 when the email does not exist or its matter is not visible to the user who owns this API key.",
            "scope": "emails:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Email id.",
                        "examples": [
                            1234
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            1234
                        ]
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the mail is filed under, or null for a caseless mail (saved outside any case)."
                    },
                    "from_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the outside party (never a colleague; the store has no direction column)."
                    },
                    "from_address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "SMTP address of the outside party."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The message body as plain text. The raw HTML body is deliberately never returned (untrusted third-party HTML). Best-effort plain text: if the original HTML carried <style>/<script>, their inner text may survive into it."
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the message was sent. Timezone is inconsistent by ingest path (IMAP stores UTC, the Outlook add-in an office-zone wall time); created_at is the reliable timestamp."
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Bytes of the stored .eml/.msg file."
                    },
                    "extension": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "\"msg\" or \"eml\"; null on some legacy rows."
                    },
                    "saved_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the colleague who saved the mail into Flowyer."
                    },
                    "saved_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of that colleague."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the mail was saved into Flowyer (office-zone wall time)."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/emails/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "litigation_list",
            "capability": "litigation.list",
            "title": "List matter litigation history",
            "description": "Lists the litigation-history entries (pertörténet) of a matter, newest event first: a dated note with a title, an HTML description and a location. Answers 404 when the matter is not visible to the user. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "litigation:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4521
                        ]
                    },
                    "title": {
                        "type": "string",
                        "description": "Entry title. Plain text.",
                        "examples": [
                            "Első tárgyalás elhalasztva"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Entry details as rich HTML, sanitised server-side."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Where it happened (plain text), e.g. a court room; nullable."
                    },
                    "event_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day of the entry, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Author (the user who created the entry)."
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author."
                    },
                    "last_editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User who last edited the entry."
                    },
                    "last_editor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the last editor."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to litigation.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/litigation",
                "args": {
                    "id": "path",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "litigation_create",
            "capability": "litigation.create",
            "title": "Create litigation history entry",
            "description": "Adds a litigation-history entry (pertörténet) to a matter: a title (plain text, \"<\"/\">\" not allowed), an optional HTML description (sanitised server-side), an optional location and an event date (defaults to today). Answers 404 when the matter is not visible.",
            "scope": "litigation:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the entry belongs to (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 2000,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "Entry title, at most 2000 characters. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Első tárgyalás elhalasztva"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Entry details. Rich HTML, sanitised server-side with the knowledge-base profile."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Where it happened (plain text, at most 255 characters); \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Fővárosi Törvényszék, 215. tárgyaló"
                        ]
                    },
                    "event_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day of the entry, YYYY-MM-DD. Defaults to today (office time zone).",
                        "examples": [
                            "2026-11-15"
                        ]
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "title"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4521
                        ]
                    },
                    "title": {
                        "type": "string",
                        "description": "Entry title. Plain text.",
                        "examples": [
                            "Első tárgyalás elhalasztva"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Entry details as rich HTML, sanitised server-side."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Where it happened (plain text), e.g. a court room; nullable."
                    },
                    "event_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day of the entry, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Author (the user who created the entry)."
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author."
                    },
                    "last_editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User who last edited the entry."
                    },
                    "last_editor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the last editor."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to litigation.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/litigation",
                "args": {
                    "id": "path",
                    "title": "body",
                    "description": "body",
                    "location": "body",
                    "event_date": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "litigation_update",
            "capability": "litigation.update",
            "title": "Update litigation history entry",
            "description": "Changes a litigation-history entry (pertörténet): title, description, location or event date. Only the fields you send are written; the description is sanitised server-side. Pass expected_updated_at from your last read; a conflicting change answers 409.",
            "scope": "litigation:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "New title, at most 2000 characters (plain text; \"<\"/\">\" not allowed). Omit to keep the current one.",
                        "examples": [
                            "Ítélethirdetés elhalasztva"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "New details (rich HTML, sanitised). Omit to keep the current one; null/empty clears it."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "New location (plain text, at most 255 characters; \"<\"/\">\" not allowed). Omit to keep it; null/empty clears it."
                    },
                    "event_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "New event day, YYYY-MM-DD. Omit to keep it; null clears it."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4521
                        ]
                    },
                    "title": {
                        "type": "string",
                        "description": "Entry title. Plain text.",
                        "examples": [
                            "Első tárgyalás elhalasztva"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Entry details as rich HTML, sanitised server-side."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Where it happened (plain text), e.g. a court room; nullable."
                    },
                    "event_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Day of the entry, YYYY-MM-DD. Flowyer records the date only, no time of day."
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Author (the user who created the entry)."
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author."
                    },
                    "last_editor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User who last edited the entry."
                    },
                    "last_editor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the last editor."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to litigation.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/litigation/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "title": "body",
                    "description": "body",
                    "location": "body",
                    "event_date": "body"
                }
            }
        },
        {
            "name": "mail_register_list",
            "capability": "mail_register.list",
            "title": "List mail register",
            "description": "Lists the mail-register (Postakönyv) entries filed against the matters the user may see, newest first. Filter by matter, direction, free text (subject/sender/addressee/tracking number) and date range. Mail of archived matters is hidden unless include_archived is true. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "mail_register:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only entries of this matter (must be visible to the user).",
                        "examples": [
                            1234
                        ]
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "Only incoming (received) or outgoing (sent) entries."
                    },
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Free-text search over subject, sender, addressee, recipient and tracking number (case ignored).",
                        "examples": [
                            "Kúria"
                        ]
                    },
                    "date_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only entries whose date is on or after this day (YYYY-MM-DD).",
                        "examples": [
                            "2026-01-01"
                        ]
                    },
                    "date_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only entries whose date is on or before this day (YYYY-MM-DD).",
                        "examples": [
                            "2026-12-31"
                        ]
                    },
                    "updated_since": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Only entries changed at or after this time (ISO 8601).",
                        "examples": [
                            "2026-10-01T00:00:00+02:00"
                        ]
                    },
                    "include_archived": {
                        "type": "boolean",
                        "description": "Include entries of archived matters.",
                        "default": false
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Mail-register entry id (use with mail_register.get / .update).",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the entry is filed against."
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD (no time of day)."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Feladó: the sender (free text)."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Címzett: the addressee (free text)."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "For an incoming mail: the display name of the colleague who received it. For an outgoing mail: the free-text addressee/received-by."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Set only for an incoming mail whose recipient is a colleague (a user id); null for an outgoing mail."
                    },
                    "electronic": {
                        "type": "boolean",
                        "description": "True when the item was recorded as electronic (type_of_mail)."
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the delivery method (mail_delivery_methods)."
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized delivery-method label (Posta, Cégkapu, Perkapu, ...), or the electronic/non-electronic fallback for a legacy row."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Azonosító: tracking number."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who recorded the entry."
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to mail_register.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/mail-register",
                "args": {
                    "matter_id": "query",
                    "direction": "query",
                    "q": "query",
                    "date_from": "query",
                    "date_to": "query",
                    "updated_since": "query",
                    "include_archived": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "mail_register_get",
            "capability": "mail_register.get",
            "title": "Get mail register entry",
            "description": "Returns one mail-register (Postakönyv) entry by id, with its updated_at (the token mail_register.update takes). Answers 404 when the entry does not exist or its matter is not visible to the user.",
            "scope": "mail_register:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Mail-register entry id.",
                        "examples": [
                            4321
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Mail-register entry id (use with mail_register.get / .update).",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the entry is filed against."
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD (no time of day)."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Feladó: the sender (free text)."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Címzett: the addressee (free text)."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "For an incoming mail: the display name of the colleague who received it. For an outgoing mail: the free-text addressee/received-by."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Set only for an incoming mail whose recipient is a colleague (a user id); null for an outgoing mail."
                    },
                    "electronic": {
                        "type": "boolean",
                        "description": "True when the item was recorded as electronic (type_of_mail)."
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the delivery method (mail_delivery_methods)."
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized delivery-method label (Posta, Cégkapu, Perkapu, ...), or the electronic/non-electronic fallback for a legacy row."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Azonosító: tracking number."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who recorded the entry."
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to mail_register.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/mail-register/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "mail_register_create",
            "capability": "mail_register.create",
            "title": "Create mail register entry",
            "description": "Files a new mail-register (Postakönyv) entry on a matter. Use recipient_user_id for an incoming mail received by a colleague, or recipient (free text) for an outgoing one. delivery_method_id must be a known method. Answers 404 when the matter is not visible.",
            "scope": "mail_register:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the entry belongs to (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD (no time of day).",
                        "examples": [
                            "2026-11-03"
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 1000,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "Subject of the correspondence. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Fellebbezés a Kúriához"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Feladó: the sender (free text). Plain text; \"<\" and \">\" are not allowed."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Címzett: the addressee (free text). Plain text; \"<\" and \">\" are not allowed."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Outgoing mail: the free-text addressee/received-by. Not allowed together with recipient_user_id. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Incoming mail: the colleague who received it (a user id from colleagues.list), stored as the numeric recipient. Not allowed together with recipient."
                    },
                    "electronic": {
                        "type": "boolean",
                        "description": "Whether the item is electronic (type_of_mail); independent of the delivery method. Default false.",
                        "default": false
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Delivery method id (mail_delivery_methods): e.g. 1 Posta, 4 Cégkapu, 7 Perkapu. 422 when unknown."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Azonosító: tracking number. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$"
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "matter_id",
                    "direction",
                    "date",
                    "subject"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Mail-register entry id (use with mail_register.get / .update).",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the entry is filed against."
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD (no time of day)."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Feladó: the sender (free text)."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Címzett: the addressee (free text)."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "For an incoming mail: the display name of the colleague who received it. For an outgoing mail: the free-text addressee/received-by."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Set only for an incoming mail whose recipient is a colleague (a user id); null for an outgoing mail."
                    },
                    "electronic": {
                        "type": "boolean",
                        "description": "True when the item was recorded as electronic (type_of_mail)."
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the delivery method (mail_delivery_methods)."
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized delivery-method label (Posta, Cégkapu, Perkapu, ...), or the electronic/non-electronic fallback for a legacy row."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Azonosító: tracking number."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who recorded the entry."
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to mail_register.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/mail-register",
                "args": {
                    "matter_id": "body",
                    "direction": "body",
                    "date": "body",
                    "subject": "body",
                    "sender": "body",
                    "to": "body",
                    "recipient": "body",
                    "recipient_user_id": "body",
                    "electronic": "body",
                    "delivery_method_id": "body",
                    "tracking_no": "body",
                    "folder_path": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "mail_register_update",
            "capability": "mail_register.update",
            "title": "Update mail register entry",
            "description": "Updates a mail-register (Postakönyv) entry; only the fields you send are changed. The entry stays on its matter. Pass expected_updated_at from your last read; a conflicting change answers 409. Answers 404 when the entry is not visible.",
            "scope": "mail_register:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "direction": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "incoming",
                            "outgoing",
                            null
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "Subject. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Feladó: the sender (free text). Plain text; \"<\" and \">\" are not allowed."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Címzett: the addressee (free text). Plain text; \"<\" and \">\" are not allowed."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Outgoing mail: the free-text addressee. Not allowed together with recipient_user_id. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Incoming mail: the receiving colleague (a user id), stored as the numeric recipient. Not allowed together with recipient."
                    },
                    "electronic": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the item is electronic (type_of_mail)."
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Delivery method id (mail_delivery_methods); 422 when unknown."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Azonosító: tracking number. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Mail-register entry id (use with mail_register.get / .update).",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter the entry is filed against."
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "incoming",
                            "outgoing"
                        ],
                        "description": "incoming = received, outgoing = sent."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Postal/recorded date, YYYY-MM-DD (no time of day)."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Feladó: the sender (free text)."
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Címzett: the addressee (free text)."
                    },
                    "recipient": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "For an incoming mail: the display name of the colleague who received it. For an outgoing mail: the free-text addressee/received-by."
                    },
                    "recipient_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Set only for an incoming mail whose recipient is a colleague (a user id); null for an outgoing mail."
                    },
                    "electronic": {
                        "type": "boolean",
                        "description": "True when the item was recorded as electronic (type_of_mail)."
                    },
                    "delivery_method_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of the delivery method (mail_delivery_methods)."
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Localized delivery-method label (Posta, Cégkapu, Perkapu, ...), or the electronic/non-electronic fallback for a legacy row."
                    },
                    "tracking_no": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Azonosító: tracking number."
                    },
                    "folder_path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recorded_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who recorded the entry."
                    },
                    "recorded_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to mail_register.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the entry through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/mail-register/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "direction": "body",
                    "date": "body",
                    "subject": "body",
                    "sender": "body",
                    "to": "body",
                    "recipient": "body",
                    "recipient_user_id": "body",
                    "electronic": "body",
                    "delivery_method_id": "body",
                    "tracking_no": "body",
                    "folder_path": "body"
                }
            }
        },
        {
            "name": "comments_list",
            "capability": "comments.list",
            "title": "List matter comments",
            "description": "Lists the comments of a matter, oldest first: id, author, body (rich HTML) and the parent_id of a reply. Flat, not nested - rebuild the one-level threads from parent_id. Pass top_level_only to exclude replies. Answers 404 when the matter is not visible to the user. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "comments:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "top_level_only": {
                        "type": "boolean",
                        "description": "Only top-level comments (exclude replies). Default false.",
                        "default": false
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "matter_id": {
                        "type": "integer",
                        "description": "The matter (= case_id) the comment belongs to."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The top-level comment this replies to; null for a top-level comment. Replies are one level deep."
                    },
                    "author_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the author (null for a legacy import)."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author, or null."
                    },
                    "body": {
                        "type": "string",
                        "description": "The comment as stored: rich HTML, already HTMLPurifier-cleaned for comments written through this API."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the comment was posted, ISO 8601 in the office zone."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Optimistic-lock token: pass it to comments.update as expected_updated_at. Not a display time; null for a legacy comment without one."
                    },
                    "edited": {
                        "type": "boolean",
                        "description": "True when the comment has been edited since it was posted."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/comments",
                "args": {
                    "id": "path",
                    "top_level_only": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "comments_create",
            "capability": "comments.create",
            "title": "Post matter comment",
            "description": "Posts a comment on a matter, or a one-level reply (parent_id = a TOP-LEVEL comment of the SAME matter). The body is rich HTML, server-side sanitised before store. Answers 404 when the matter is not visible, 422 when parent_id is not a top-level comment of the matter.",
            "scope": "comments:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id (must be visible).",
                        "examples": [
                            1234
                        ]
                    },
                    "body": {
                        "type": "string",
                        "minLength": 1,
                        "description": "The comment, rich HTML (as TinyMCE produces). Server-side HTMLPurifier-cleaned before store. At most 100000 characters.",
                        "examples": [
                            "<p>Egyetértek, a határidő tartható.</p>"
                        ]
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Reply to this TOP-LEVEL comment of the SAME matter (from comments.list, parent_id = null); omit for a new top-level comment."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "body"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "matter_id": {
                        "type": "integer",
                        "description": "The matter (= case_id) the comment belongs to."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The top-level comment this replies to; null for a top-level comment. Replies are one level deep."
                    },
                    "author_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the author (null for a legacy import)."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author, or null."
                    },
                    "body": {
                        "type": "string",
                        "description": "The comment as stored: rich HTML, already HTMLPurifier-cleaned for comments written through this API."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the comment was posted, ISO 8601 in the office zone."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Optimistic-lock token: pass it to comments.update as expected_updated_at. Not a display time; null for a legacy comment without one."
                    },
                    "edited": {
                        "type": "boolean",
                        "description": "True when the comment has been edited since it was posted."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/comments",
                "args": {
                    "id": "path",
                    "body": "body",
                    "parent_id": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "comments_update",
            "capability": "comments.update",
            "title": "Edit own matter comment",
            "description": "Edits one of your OWN comments (its body only; rich HTML, server-side sanitised before store). Pass expected_updated_at from your last read; a conflicting change answers 409. Answers 404 for a comment that is not yours or on a matter you cannot see.",
            "scope": "comments:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "body": {
                        "type": "string",
                        "minLength": 1,
                        "description": "New comment body, rich HTML (as TinyMCE produces). Server-side HTMLPurifier-cleaned before store. At most 100000 characters.",
                        "examples": [
                            "<p>Pontosítás: a határidő november 15.</p>"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "body"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            9876
                        ]
                    },
                    "matter_id": {
                        "type": "integer",
                        "description": "The matter (= case_id) the comment belongs to."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The top-level comment this replies to; null for a top-level comment. Replies are one level deep."
                    },
                    "author_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "User id of the author (null for a legacy import)."
                    },
                    "author_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display name of the author, or null."
                    },
                    "body": {
                        "type": "string",
                        "description": "The comment as stored: rich HTML, already HTMLPurifier-cleaned for comments written through this API."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the comment was posted, ISO 8601 in the office zone."
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Optimistic-lock token: pass it to comments.update as expected_updated_at. Not a display time; null for a legacy comment without one."
                    },
                    "edited": {
                        "type": "boolean",
                        "description": "True when the comment has been edited since it was posted."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/comments/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "body": "body"
                }
            }
        },
        {
            "name": "trials_list",
            "capability": "trials.list",
            "title": "List matter hearings",
            "description": "Lists the court hearings (tárgyalások) of a matter: date, court, place, the attending colleagues and the judge, newest first. Optionally filtered by a from/to day range or by updated_since. Answers 404 when the matter is not visible to the user. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "trials:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter id.",
                        "examples": [
                            1234
                        ]
                    },
                    "from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only hearings on or after this day (YYYY-MM-DD), in the office time zone.",
                        "examples": [
                            "2026-01-01"
                        ]
                    },
                    "to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only hearings on or before this day (YYYY-MM-DD), in the office time zone.",
                        "examples": [
                            "2026-12-31"
                        ]
                    },
                    "updated_since": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Only hearings changed at or after this ISO 8601 time."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter (case) the hearing belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Hearing date and time, ISO 8601 in the office time zone. It is stored in UTC, so compare instants rather than the wall-clock text.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required: \"required\", \"not_required\", or null when unset."
                    },
                    "court": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "address": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "source": {
                                "type": "string",
                                "description": "Always \"registry\": the court is a reference to the shared court registry (courts.list), not free text."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The court of the hearing, resolved from the shared court registry; null when no court is set."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Room or location of the hearing. Plain text."
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Name of the judge. Plain text."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text notes on the hearing. Plain text."
                    },
                    "responsibles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "user_id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Colleagues attending the hearing (ids from colleagues.list)."
                    },
                    "recorded_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who recorded the hearing."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to trials.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/matters/{id}/trials",
                "args": {
                    "id": "path",
                    "from": "query",
                    "to": "query",
                    "updated_since": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "trials_get",
            "capability": "trials.get",
            "title": "Get hearing",
            "description": "Returns one court hearing (tárgyalás) with its matter, court, attending colleagues and the updated_at lock token for trials.update. Answers 404 when the hearing does not exist or the user may not see its matter.",
            "scope": "trials:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Hearing id.",
                        "examples": [
                            4321
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter (case) the hearing belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Hearing date and time, ISO 8601 in the office time zone. It is stored in UTC, so compare instants rather than the wall-clock text.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required: \"required\", \"not_required\", or null when unset."
                    },
                    "court": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "address": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "source": {
                                "type": "string",
                                "description": "Always \"registry\": the court is a reference to the shared court registry (courts.list), not free text."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The court of the hearing, resolved from the shared court registry; null when no court is set."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Room or location of the hearing. Plain text."
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Name of the judge. Plain text."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text notes on the hearing. Plain text."
                    },
                    "responsibles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "user_id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Colleagues attending the hearing (ids from colleagues.list)."
                    },
                    "recorded_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who recorded the hearing."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to trials.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/trials/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "trials_create",
            "capability": "trials.create",
            "title": "Create hearing",
            "description": "Records a court hearing (tárgyalás) on a matter: time, an optional court (court_id from courts.list), the room, judge, notes and attending colleagues. The matter must be visible and not archived; attendees are notified. A time with no offset is read in the office zone.",
            "scope": "trials:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Matter the hearing belongs to (must be visible and not archived).",
                        "examples": [
                            1234
                        ]
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Hearing date and time, ISO 8601. With an offset it is honoured; without one it is read in the office time zone. Stored in UTC.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "court_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Court of the hearing: an id from courts.list (the shared court registry). Omit when the court is not known.",
                        "examples": [
                            42
                        ]
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required. Omit to leave it unset."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Room or location of the hearing. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "II. emelet 205."
                        ]
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Name of the judge. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "pattern": "^[^<>]*$",
                        "description": "Free-text notes on the hearing. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "responsible_user_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Colleague user ids (from colleagues.list) attending the hearing."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "date"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter (case) the hearing belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Hearing date and time, ISO 8601 in the office time zone. It is stored in UTC, so compare instants rather than the wall-clock text.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required: \"required\", \"not_required\", or null when unset."
                    },
                    "court": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "address": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "source": {
                                "type": "string",
                                "description": "Always \"registry\": the court is a reference to the shared court registry (courts.list), not free text."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The court of the hearing, resolved from the shared court registry; null when no court is set."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Room or location of the hearing. Plain text."
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Name of the judge. Plain text."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text notes on the hearing. Plain text."
                    },
                    "responsibles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "user_id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Colleagues attending the hearing (ids from colleagues.list)."
                    },
                    "recorded_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who recorded the hearing."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to trials.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/matters/{id}/trials",
                "args": {
                    "id": "path",
                    "date": "body",
                    "court_id": "body",
                    "participation": "body",
                    "place": "body",
                    "name_of_the_judge": "body",
                    "notes": "body",
                    "responsible_user_ids": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "trials_update",
            "capability": "trials.update",
            "title": "Update hearing",
            "description": "Updates a court hearing (tárgyalás): its time, court, place, judge, notes, attendance flag and attendees. Writes only the fields you send; send responsible_user_ids to replace the whole attendee list. Pass expected_updated_at from your last read; a conflicting change answers 409.",
            "scope": "trials:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "New hearing date and time, ISO 8601 (an offset is honoured, a naive time is read in the office zone). Stored in UTC.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "court_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "New court id from courts.list; null to clear the court."
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required; null to clear it."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Room or location. Plain text; \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Name of the judge. Plain text; \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "pattern": "^[^<>]*$",
                        "description": "Free-text notes. Plain text; \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "responsible_user_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Full replacement set of attendee user ids (from colleagues.list). Omit to leave the attendees unchanged."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "matter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter (case) the hearing belongs to."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Hearing date and time, ISO 8601 in the office time zone. It is stored in UTC, so compare instants rather than the wall-clock text.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "participation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "required",
                            "not_required",
                            null
                        ],
                        "description": "Whether a colleague's attendance is required: \"required\", \"not_required\", or null when unset."
                    },
                    "court": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "zip": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "address": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "source": {
                                "type": "string",
                                "description": "Always \"registry\": the court is a reference to the shared court registry (courts.list), not free text."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The court of the hearing, resolved from the shared court registry; null when no court is set."
                    },
                    "place": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Room or location of the hearing. Plain text."
                    },
                    "name_of_the_judge": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Name of the judge. Plain text."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text notes on the hearing. Plain text."
                    },
                    "responsibles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "user_id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Colleagues attending the hearing (ids from colleagues.list)."
                    },
                    "recorded_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who recorded the hearing."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to trials.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/trials/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "date": "body",
                    "court_id": "body",
                    "participation": "body",
                    "place": "body",
                    "name_of_the_judge": "body",
                    "notes": "body",
                    "responsible_user_ids": "body"
                }
            }
        },
        {
            "name": "courts_list",
            "capability": "courts.list",
            "title": "List courts",
            "description": "Lists the shared court registry (id, name, city) for the court_id of trials.create / trials.update. With `q` (a court name as heard; accents, casing and small typos tolerated) answers status exact/similar/none: only \"exact\" is safe to use directly. It is the Hungarian court directory.",
            "scope": "courts:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "q": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "A court name to look up, as heard or dictated, in any word order. Omit it to list every court.",
                        "examples": [
                            "Fővárosi Törvényszék"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500,
                        "description": "Maximum courts to return (default 200).",
                        "default": 200
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "exact",
                            "similar",
                            "none",
                            null
                        ],
                        "description": "Only with `q`: exact = one confident match (safe to use its id), similar = approximate or several matches (confirm with the user first), none = no match (ask the user). Null without `q`."
                    },
                    "courts": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "description": "Court id: pass it as court_id to trials.create / trials.update."
                                },
                                "name": {
                                    "type": "string",
                                    "description": "Court name as shown in Flowyer."
                                },
                                "city": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "zip": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "address": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "Courts, best match first with `q`, otherwise by name."
                    },
                    "total": {
                        "type": "integer",
                        "description": "How many courts matched (all courts without `q`) before the list was cut to `limit`."
                    },
                    "truncated": {
                        "type": "boolean",
                        "description": "True when more courts matched than were returned: narrow `q` or raise `limit`."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/courts",
                "args": {
                    "q": "query",
                    "limit": "query"
                }
            }
        },
        {
            "name": "hr_leaves_list",
            "capability": "hr.leaves.list",
            "title": "List staff leaves",
            "description": "Lists approved staff leaves (who is or will be on leave): the colleague, start/end dates, working-day count, a privacy-redacted category (leave/unpaid; sick is merged into leave and never identifiable) and any substitute. Never returns the leave type, notes or who approved it. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "hr:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only this colleague's leaves. A central user id (from colleagues.list), matched to the employee behind the leave.",
                        "examples": [
                            1234
                        ]
                    },
                    "on_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Who is on leave on this exact day (start_date <= on_date <= end_date). When set, it overrides date_from, date_to and timeframe."
                    },
                    "date_from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only leaves still running on or after this date (end_date >= date_from). Defaults to today, so fully past leaves are excluded by default."
                    },
                    "date_to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only leaves starting on or before this date (start_date <= date_to). Omit for open-ended future."
                    },
                    "timeframe": {
                        "type": "string",
                        "enum": [
                            "current",
                            "upcoming",
                            "all"
                        ],
                        "description": "Extra start-date constraint versus today: current = already started (ongoing), upcoming = not yet started, all = no extra. Ignored when on_date is set.",
                        "default": "all"
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Leave request id (a handle only; not sensitive)."
                    },
                    "user_id": {
                        "type": "integer",
                        "description": "The colleague on leave (central user id)."
                    },
                    "user": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The colleague's display name."
                    },
                    "start_date": {
                        "type": "string",
                        "format": "date",
                        "description": "First day of leave (YYYY-MM-DD)."
                    },
                    "end_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Last day of leave, inclusive (YYYY-MM-DD)."
                    },
                    "days_count": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Working days of leave. Does not reveal the type."
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "leave",
                            "unpaid"
                        ],
                        "description": "Privacy-redacted leave type: annual and sick both become \"leave\" (sick is never identifiable), unpaid stays \"unpaid\". The raw leave type is never exposed."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "approved"
                        ],
                        "description": "Always \"approved\" - only approved leaves are returned; pending, rejected and cancelled never surface."
                    },
                    "substitute_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Covering colleague for this leave (central user id), or null."
                    },
                    "substitute_user": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Covering colleague's display name, or null."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/hr/leaves",
                "args": {
                    "user_id": "query",
                    "on_date": "query",
                    "date_from": "query",
                    "date_to": "query",
                    "timeframe": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "calendar_events_list",
            "capability": "calendar.events.list",
            "title": "List calendar events",
            "description": "Lists calendar events overlapping a [from, to] date range: the office calendar, your own and calendars shared with you. Recurring events are returned once (is_recurring), NOT expanded. Ordered by start. A personal event not shared with you never appears. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "calendar:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "from": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Range start (inclusive), ISO 8601. Events overlapping [from, to] are returned. A time with no offset is read in the office zone.",
                        "examples": [
                            "2026-03-01T00:00:00+01:00"
                        ]
                    },
                    "to": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Range end (inclusive), ISO 8601. Must be on or after `from` (else 422) and at most 366 days after it.",
                        "examples": [
                            "2026-03-31T23:59:59+01:00"
                        ]
                    },
                    "calendar_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "description": "Narrow to these container calendar ids; each is intersected with the calendars you may view, so an id you cannot see is silently dropped. Omit for every visible calendar."
                    },
                    "include_recurring": {
                        "type": "boolean",
                        "description": "Include recurring master events whose rule overlaps the range (returned un-expanded, is_recurring = true). Default true.",
                        "default": true
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "from",
                    "to"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            5501
                        ]
                    },
                    "calendar": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Container calendar id, or null for the implicit shared office calendar (a legacy event with no container)."
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "type": {
                                "type": "string",
                                "enum": [
                                    "office",
                                    "personal"
                                ],
                                "description": "\"office\" = the shared office calendar (every office user may view and edit it); \"personal\" = a user's own calendar, visible only to its owner and those it is shared with."
                            },
                            "owner": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                },
                                "additionalProperties": false,
                                "description": "Owner of a personal calendar; null for the office calendar."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The calendar the event belongs to."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event title. Plain text."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event description. Plain text."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Location. Plain text."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Participants, free text. Plain text."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "An all-day event: the start date \"YYYY-MM-DD\". A timed event: ISO 8601 in the office time zone (the stored UTC instant).",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Same encoding as start. For an all-day event the end date is INCLUSIVE (the stored value, not the +1-day value a calendar grid uses). Null when the event has no end."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "True for an all-day event (start/end are bare dates); false for a timed event (start/end are ISO 8601 instants)."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display colour, e.g. \"#2c7be5\"."
                    },
                    "is_recurring": {
                        "type": "boolean",
                        "description": "True when the event is a recurring master. Recurring events are returned once, NOT expanded into occurrences, and cannot be modified through calendar.events.update."
                    },
                    "recurrence": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "freq": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "daily | weekly | monthly | yearly."
                            },
                            "interval": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "byweekday": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "Comma-separated weekday codes (e.g. \"MO,WE,FR\")."
                            },
                            "until": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "count": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The recurrence rule of a recurring master, or null for a single event. Read-only."
                    },
                    "created_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who created the event."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to calendar.events.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/calendar/events",
                "args": {
                    "from": "query",
                    "to": "query",
                    "calendar_ids": "query",
                    "include_recurring": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "calendar_events_get",
            "capability": "calendar.events.get",
            "title": "Get calendar event",
            "description": "Returns one calendar event with its calendar, recurrence summary and the updated_at lock token for calendar.events.update. Answers 404 when the event does not exist or its calendar is not visible to the user.",
            "scope": "calendar:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Event id.",
                        "examples": [
                            5501
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            5501
                        ]
                    },
                    "calendar": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Container calendar id, or null for the implicit shared office calendar (a legacy event with no container)."
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "type": {
                                "type": "string",
                                "enum": [
                                    "office",
                                    "personal"
                                ],
                                "description": "\"office\" = the shared office calendar (every office user may view and edit it); \"personal\" = a user's own calendar, visible only to its owner and those it is shared with."
                            },
                            "owner": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                },
                                "additionalProperties": false,
                                "description": "Owner of a personal calendar; null for the office calendar."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The calendar the event belongs to."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event title. Plain text."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event description. Plain text."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Location. Plain text."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Participants, free text. Plain text."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "An all-day event: the start date \"YYYY-MM-DD\". A timed event: ISO 8601 in the office time zone (the stored UTC instant).",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Same encoding as start. For an all-day event the end date is INCLUSIVE (the stored value, not the +1-day value a calendar grid uses). Null when the event has no end."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "True for an all-day event (start/end are bare dates); false for a timed event (start/end are ISO 8601 instants)."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display colour, e.g. \"#2c7be5\"."
                    },
                    "is_recurring": {
                        "type": "boolean",
                        "description": "True when the event is a recurring master. Recurring events are returned once, NOT expanded into occurrences, and cannot be modified through calendar.events.update."
                    },
                    "recurrence": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "freq": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "daily | weekly | monthly | yearly."
                            },
                            "interval": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "byweekday": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "Comma-separated weekday codes (e.g. \"MO,WE,FR\")."
                            },
                            "until": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "count": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The recurrence rule of a recurring master, or null for a single event. Read-only."
                    },
                    "created_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who created the event."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to calendar.events.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/calendar/events/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "calendar_events_create",
            "capability": "calendar.events.create",
            "title": "Create calendar event",
            "description": "Creates a single calendar event (timed or all-day) on the office calendar or a calendar you may edit. A timed start/end honours an ISO 8601 offset, a naive time is read in the office zone; an all-day end date is inclusive. Recurring events are not created here. Not pushed to external calendars.",
            "scope": "calendar:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "Event title. Plain text; \"<\" and \">\" are not allowed (it flows unescaped into the reminder notification).",
                        "examples": [
                            "Ügyfél egyeztetés"
                        ]
                    },
                    "start": {
                        "type": "string",
                        "description": "All-day (all_day true): a date \"YYYY-MM-DD\". Timed (all_day false): ISO 8601; an offset is honoured, a naive time is read in the office zone.",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Same encoding as start. Default = start. For an all-day event the end date is INCLUSIVE. Must not be before start (else 422)."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "Whether the event is all-day. Default false (timed).",
                        "default": false
                    },
                    "calendar_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "description": "Target container calendar; default = the office calendar. You must hold edit rights on it (else 403). Only on a tenant with the personal-calendar feature."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Location. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "pattern": "^[^<>]*$",
                        "description": "Description, plain text (not HTML); \"<\" and \">\" are not allowed."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Participants, free text. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "pattern": "^#?[A-Za-z0-9_-]{1,31}$",
                        "description": "Display colour, e.g. \"#2c7be5\"."
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "title",
                    "start"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            5501
                        ]
                    },
                    "calendar": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Container calendar id, or null for the implicit shared office calendar (a legacy event with no container)."
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "type": {
                                "type": "string",
                                "enum": [
                                    "office",
                                    "personal"
                                ],
                                "description": "\"office\" = the shared office calendar (every office user may view and edit it); \"personal\" = a user's own calendar, visible only to its owner and those it is shared with."
                            },
                            "owner": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                },
                                "additionalProperties": false,
                                "description": "Owner of a personal calendar; null for the office calendar."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The calendar the event belongs to."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event title. Plain text."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event description. Plain text."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Location. Plain text."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Participants, free text. Plain text."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "An all-day event: the start date \"YYYY-MM-DD\". A timed event: ISO 8601 in the office time zone (the stored UTC instant).",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Same encoding as start. For an all-day event the end date is INCLUSIVE (the stored value, not the +1-day value a calendar grid uses). Null when the event has no end."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "True for an all-day event (start/end are bare dates); false for a timed event (start/end are ISO 8601 instants)."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display colour, e.g. \"#2c7be5\"."
                    },
                    "is_recurring": {
                        "type": "boolean",
                        "description": "True when the event is a recurring master. Recurring events are returned once, NOT expanded into occurrences, and cannot be modified through calendar.events.update."
                    },
                    "recurrence": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "freq": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "daily | weekly | monthly | yearly."
                            },
                            "interval": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "byweekday": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "Comma-separated weekday codes (e.g. \"MO,WE,FR\")."
                            },
                            "until": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "count": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The recurrence rule of a recurring master, or null for a single event. Read-only."
                    },
                    "created_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who created the event."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to calendar.events.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/calendar/events",
                "args": {
                    "title": "body",
                    "start": "body",
                    "end": "body",
                    "all_day": "body",
                    "calendar_id": "body",
                    "location": "body",
                    "description": "body",
                    "participants": "body",
                    "color": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "calendar_events_update",
            "capability": "calendar.events.update",
            "title": "Update calendar event",
            "description": "Updates a single calendar event: title, start/end, all_day, location, description, participants, colour. Writes only the fields you send; \"\" clears location/description/participants. A recurring event answers 422. Pass expected_updated_at from your last read; a conflicting change answers 409.",
            "scope": "calendar:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 255,
                        "minLength": 1,
                        "pattern": "^[^<>]*$",
                        "description": "New title. Plain text; \"<\" and \">\" are not allowed."
                    },
                    "start": {
                        "type": "string",
                        "description": "New start. All-day: \"YYYY-MM-DD\". Timed: ISO 8601 (an offset honoured, a naive time read in the office zone). Re-encoded if all_day changes."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "New end, same encoding as start; \"\" clears it. For an all-day event the end date is inclusive. Must not be before start (else 422)."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "If sent, start/end are re-encoded accordingly; if omitted, the row's current all_day is used."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Location. Plain text; \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 10000,
                        "pattern": "^[^<>]*$",
                        "description": "Description, plain text (not HTML); \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "pattern": "^[^<>]*$",
                        "description": "Participants, free text. Plain text; \"<\" and \">\" are not allowed. \"\" clears it."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "pattern": "^#?[A-Za-z0-9_-]{1,31}$",
                        "description": "Display colour, e.g. \"#2c7be5\". \"\" clears it."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            5501
                        ]
                    },
                    "calendar": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Container calendar id, or null for the implicit shared office calendar (a legacy event with no container)."
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "type": {
                                "type": "string",
                                "enum": [
                                    "office",
                                    "personal"
                                ],
                                "description": "\"office\" = the shared office calendar (every office user may view and edit it); \"personal\" = a user's own calendar, visible only to its owner and those it is shared with."
                            },
                            "owner": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                },
                                "additionalProperties": false,
                                "description": "Owner of a personal calendar; null for the office calendar."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The calendar the event belongs to."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event title. Plain text."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Event description. Plain text."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Location. Plain text."
                    },
                    "participants": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Participants, free text. Plain text."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "An all-day event: the start date \"YYYY-MM-DD\". A timed event: ISO 8601 in the office time zone (the stored UTC instant).",
                        "examples": [
                            "2026-03-02T09:00:00+01:00"
                        ]
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Same encoding as start. For an all-day event the end date is INCLUSIVE (the stored value, not the +1-day value a calendar grid uses). Null when the event has no end."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "True for an all-day event (start/end are bare dates); false for a timed event (start/end are ISO 8601 instants)."
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Display colour, e.g. \"#2c7be5\"."
                    },
                    "is_recurring": {
                        "type": "boolean",
                        "description": "True when the event is a recurring master. Recurring events are returned once, NOT expanded into occurrences, and cannot be modified through calendar.events.update."
                    },
                    "recurrence": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "freq": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "daily | weekly | monthly | yearly."
                            },
                            "interval": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "byweekday": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "Comma-separated weekday codes (e.g. \"MO,WE,FR\")."
                            },
                            "until": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "count": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The recurrence rule of a recurring master, or null for a single event. Read-only."
                    },
                    "created_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague who created the event."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to calendar.events.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the record through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/calendar/events/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "title": "body",
                    "start": "body",
                    "end": "body",
                    "all_day": "body",
                    "location": "body",
                    "description": "body",
                    "participants": "body",
                    "color": "body"
                }
            }
        },
        {
            "name": "bookings_list",
            "capability": "bookings.list",
            "title": "List bookings",
            "description": "Lists the office's appointment bookings (időpontfoglalások), newest first. Optionally filtered by a from/to day range (booking time zone), a lawyer (user_id), a status or updated_since. Every key-holder sees all lawyers' bookings. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "bookings:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "from": {
                        "type": "string",
                        "format": "date",
                        "description": "Only bookings on or after this day (YYYY-MM-DD), matched literally against the booking-zone date.",
                        "examples": [
                            "2026-01-01"
                        ]
                    },
                    "to": {
                        "type": "string",
                        "format": "date",
                        "description": "Only bookings on or before this day (YYYY-MM-DD).",
                        "examples": [
                            "2026-12-31"
                        ]
                    },
                    "user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Filter to one lawyer (user_id from colleagues.list). Omit for every lawyer of the office."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "Filter by status."
                    },
                    "updated_since": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Only bookings changed at or after this ISO 8601 time (updated_at is office-zone naive)."
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/bookings",
                "args": {
                    "from": "query",
                    "to": "query",
                    "user_id": "query",
                    "status": "query",
                    "updated_since": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "bookings_get",
            "capability": "bookings.get",
            "title": "Get booking",
            "description": "Returns one appointment booking with the lawyer, the client's details, the start/end instants, payment state and the updated_at lock token for bookings.update / .confirm / .cancel. Answers 404 when the booking does not exist in this office.",
            "scope": "bookings:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Booking id.",
                        "examples": [
                            4321
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/bookings/{id}",
                "args": {
                    "id": "path"
                }
            }
        },
        {
            "name": "bookings_create",
            "capability": "bookings.create",
            "title": "Create booking",
            "description": "Books an appointment and EMAILS THE CLIENT the confirmation. Requires a free slot for the lawyer (else 409); the office calendar never blocks. source is \"manual\". An Idempotency-Key replay neither re-books nor re-emails.",
            "scope": "bookings:create",
            "input_schema": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Lawyer the appointment is with (user_id from colleagues.list; must be an active office colleague).",
                        "examples": [
                            42
                        ]
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Appointment day (YYYY-MM-DD) in the booking time zone.",
                        "examples": [
                            "2026-03-02"
                        ]
                    },
                    "time": {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                        "description": "Start time HH:MM (24h) in the booking time zone. The end time is time + the office slot length. Must be a free slot.",
                        "examples": [
                            "09:00"
                        ]
                    },
                    "client_name": {
                        "type": "string",
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "The client's name. Plain text; \"<\" and \">\" are not allowed.",
                        "examples": [
                            "Kovács Anna"
                        ]
                    },
                    "client_email": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "The client's e-mail: the recipient of the confirmation.",
                        "examples": [
                            "anna@example.com"
                        ]
                    },
                    "client_phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50,
                        "pattern": "^[^<>]*$",
                        "description": "The client's phone. Plain text."
                    },
                    "client_description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "pattern": "^[^<>]*$",
                        "description": "Subject / notes from the client. Plain text."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "In-office or online consultation. Default \"office\".",
                        "default": "office"
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500,
                        "description": "Online-meeting URL (http/https), for an online consultation."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Record the client's data-handling consent. Default true (office staff books on the client's behalf).",
                        "default": true
                    },
                    "auto_confirm": {
                        "type": "boolean",
                        "description": "When true (or the office has auto-confirm on), create the booking already confirmed: run the calendar sync and send the client a confirmation instead of a request. Otherwise it is pending.",
                        "default": false
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "user_id",
                    "date",
                    "time",
                    "client_name",
                    "client_email"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/bookings",
                "args": {
                    "user_id": "body",
                    "date": "body",
                    "time": "body",
                    "client_name": "body",
                    "client_email": "body",
                    "client_phone": "body",
                    "client_description": "body",
                    "location_preference": "body",
                    "meeting_link": "body",
                    "gdpr_consent": "body",
                    "auto_confirm": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "bookings_update",
            "capability": "bookings.update",
            "title": "Update booking",
            "description": "Reschedules (date + time together, re-checked for a free slot) or edits a booking (phone, notes, meeting link, location). Writes only the fields you send. Notifies the lawyer of a reschedule, never the client. Pass expected_updated_at from your last read; a stale write answers 409.",
            "scope": "bookings:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "New day (YYYY-MM-DD) in the booking time zone. Send date AND time together to reschedule.",
                        "examples": [
                            "2026-03-05"
                        ]
                    },
                    "time": {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                        "description": "New start time HH:MM. The end time is recomputed from the office slot length. Send date AND time together.",
                        "examples": [
                            "11:00"
                        ]
                    },
                    "client_phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50,
                        "pattern": "^[^<>]*$",
                        "description": "The client's phone. Plain text. \"\" clears it."
                    },
                    "client_description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "pattern": "^[^<>]*$",
                        "description": "Subject / notes. Plain text. \"\" clears it."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500,
                        "description": "Online-meeting URL (http/https). \"\" clears it."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "In-office or online consultation."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/bookings/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "date": "body",
                    "time": "body",
                    "client_phone": "body",
                    "client_description": "body",
                    "meeting_link": "body",
                    "location_preference": "body"
                }
            }
        },
        {
            "name": "bookings_confirm",
            "capability": "bookings.confirm",
            "title": "Confirm booking",
            "description": "Confirms a pending booking and EMAILS THE CLIENT the confirmation (with the meeting link for an online one). Only a pending booking can be confirmed; any other status answers 409, so a retry never re-emails. Optionally pass expected_updated_at as a lock token.",
            "scope": "bookings:send",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Booking id.",
                        "examples": [
                            4321
                        ]
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Optional optimistic-lock token: the updated_at from your last read. If the booking changed since, the API answers 409 and you re-read before retrying."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500,
                        "description": "Online-meeting URL (http/https) to set on the booking before the confirmation e-mail goes out."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "POST",
                "path": "/bookings/{id}/confirm",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "meeting_link": "body"
                }
            }
        },
        {
            "name": "bookings_cancel",
            "capability": "bookings.cancel",
            "title": "Cancel booking",
            "description": "Cancels a booking and EMAILS THE CLIENT (and the lawyer) the cancellation. A booking already cancelled or completed answers 409, so a retry never re-emails. A paid booking is cancelled but never refunded (the office handles that). Optionally pass expected_updated_at.",
            "scope": "bookings:send",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Booking id.",
                        "examples": [
                            4321
                        ]
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Optional optimistic-lock token: the updated_at from your last read. If the booking changed since, the API answers 409."
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "pattern": "^[^<>]*$",
                        "description": "Reason recorded as cancel_reason and shown in the cancellation e-mail. Plain text; \"<\" and \">\" are not allowed."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "booking_number": {
                        "type": "string",
                        "description": "Human booking number, e.g. \"#B-0001\"."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "cancelled",
                            "completed",
                            "awaiting_payment",
                            "expired"
                        ],
                        "description": "pending = awaiting the lawyer's confirmation; confirmed = approved; cancelled/completed; awaiting_payment/expired belong to the pay-before-confirm flow."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "flowyer",
                            "website",
                            "embed_widget",
                            "manual"
                        ],
                        "description": "Where the booking came from. An API-created booking is \"manual\"."
                    },
                    "lawyer": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The lawyer (user_id from colleagues.list) the appointment is with."
                    },
                    "date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Calendar date in the booking time zone (YYYY-MM-DD), stored literally."
                    },
                    "start_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Start time HH:MM in the booking time zone."
                    },
                    "end_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "End time HH:MM in the booking time zone."
                    },
                    "start": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the start, composed with the booking time zone. Use this to compare instants across zones."
                    },
                    "end": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Unambiguous ISO 8601 instant of the end."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The booking time zone (booking_settings.timezone), e.g. \"Europe/Budapest\". It governs date, start_time and end_time."
                    },
                    "location_preference": {
                        "type": "string",
                        "enum": [
                            "office",
                            "online"
                        ],
                        "description": "Whether the consultation is in the office or online."
                    },
                    "meeting_link": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Online-meeting URL, when set."
                    },
                    "client": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "phone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external client who booked: name, e-mail, phone and the subject/notes. Personal data — for office staff only."
                    },
                    "gdpr_consent": {
                        "type": "boolean",
                        "description": "Whether the client's data-handling consent is recorded."
                    },
                    "gdpr_consent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the consent was recorded."
                    },
                    "cancel_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reason recorded on cancellation."
                    },
                    "payment": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "awaiting",
                                    "partial",
                                    "paid",
                                    "refunded"
                                ]
                            },
                            "method": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "card",
                                    "transfer",
                                    null
                                ]
                            },
                            "amount": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "invoice_number": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "Read-only payment state. The API never changes payment; booking fees are handled in Flowyer."
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to bookings.update / bookings.confirm / bookings.cancel as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when an external agent created the booking through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "POST",
                "path": "/bookings/{id}/cancel",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "reason": "body"
                }
            }
        },
        {
            "name": "tickets_list",
            "capability": "tickets.list",
            "title": "List tickets",
            "description": "Lists the support tickets the user may see (per-mailbox visibility), newest activity first. Filter by status (default open_states = new+open+pending; \"all\" includes closed), mailbox, assignee, requester email, or free text over subject/requester/ticket number. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "tickets:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed",
                            "open_states",
                            "all"
                        ],
                        "description": "open_states (default) = new+open+pending (the web default view); \"all\" includes closed; or one exact status.",
                        "default": "open_states"
                    },
                    "mailbox_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only tickets from this mailbox. A mailbox the user may not see yields an empty list (never a leak).",
                        "examples": [
                            7
                        ]
                    },
                    "assigned_to_user_id": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Only tickets assigned to this colleague (id from colleagues.list); 0 = only unassigned tickets. Omit for any assignee."
                    },
                    "requester_email": {
                        "type": "string",
                        "maxLength": 255,
                        "description": "Only tickets whose external requester email matches exactly (case-insensitive).",
                        "examples": [
                            "ugyfel@example.com"
                        ]
                    },
                    "q": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Free-text search over subject, requester name/email and ticket number (case ignored).",
                        "examples": [
                            "számla"
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Ticket id (use with tickets.get / tickets.update).",
                        "examples": [
                            4321
                        ]
                    },
                    "ticket_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Human ticket number, e.g. FLW-000123."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ]
                    },
                    "priority": {
                        "type": "string",
                        "enum": [
                            "low",
                            "normal",
                            "high"
                        ]
                    },
                    "mailbox": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "display_name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The mailbox the ticket arrived through (central registry)."
                    },
                    "requester": {
                        "type": "object",
                        "properties": {
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external person who wrote in."
                    },
                    "assigned_to": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague the ticket is assigned to, or null when unassigned."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter linked to the ticket, or null."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client linked to the ticket, or null."
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Time of the most recent thread activity; the list is ordered by this, newest first."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to tickets.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when the ticket was created through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/tickets",
                "args": {
                    "status": "query",
                    "mailbox_id": "query",
                    "assigned_to_user_id": "query",
                    "requester_email": "query",
                    "q": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "tickets_get",
            "capability": "tickets.get",
            "title": "Get ticket",
            "description": "Returns one support ticket with its message thread (oldest first) and the linked matter/client. Answers 404 when the ticket does not exist or is in a mailbox the user may not see. The read never changes the ticket (a NEW ticket is not flipped to OPEN).",
            "scope": "tickets:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Ticket id.",
                        "examples": [
                            4321
                        ]
                    },
                    "messages_limit": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "maximum": 500,
                        "description": "Return only the newest N messages of the thread (still presented oldest first). Omit for the whole thread."
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Ticket id (use with tickets.get / tickets.update).",
                        "examples": [
                            4321
                        ]
                    },
                    "ticket_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Human ticket number, e.g. FLW-000123."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ]
                    },
                    "priority": {
                        "type": "string",
                        "enum": [
                            "low",
                            "normal",
                            "high"
                        ]
                    },
                    "mailbox": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "display_name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The mailbox the ticket arrived through (central registry)."
                    },
                    "requester": {
                        "type": "object",
                        "properties": {
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external person who wrote in."
                    },
                    "assigned_to": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague the ticket is assigned to, or null when unassigned."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter linked to the ticket, or null."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client linked to the ticket, or null."
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Time of the most recent thread activity; the list is ordered by this, newest first."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to tickets.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when the ticket was created through this API."
                    },
                    "messages": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "direction": {
                                    "type": "string",
                                    "enum": [
                                        "in",
                                        "out",
                                        "note"
                                    ],
                                    "description": "in = from the requester, out = reply/auto-ack sent from the mailbox, note = internal."
                                },
                                "from": {
                                    "type": "object",
                                    "properties": {
                                        "email": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "name": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "to": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "email": {
                                                "type": "string"
                                            },
                                            "name": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            }
                                        },
                                        "additionalProperties": false
                                    }
                                },
                                "cc": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "email": {
                                                "type": "string"
                                            },
                                            "name": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            }
                                        },
                                        "additionalProperties": false
                                    }
                                },
                                "sent_status": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "enum": [
                                        "pending",
                                        "sent",
                                        "failed",
                                        "scheduled",
                                        null
                                    ],
                                    "description": "Delivery state of an outbound message; null for in/note."
                                },
                                "body_text": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "description": "Message body as plain text. The HTML body is deliberately omitted to keep the thread compact; when the stored text is empty it is rendered down from the HTML."
                                },
                                "has_attachments": {
                                    "type": "boolean"
                                },
                                "author": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "additionalProperties": false,
                                    "description": "The colleague who wrote an out/note message; null for an incoming message."
                                },
                                "created_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "The message thread, oldest first."
                    },
                    "linked_matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter linked to the ticket (same as `matter`)."
                    },
                    "linked_client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client linked to the ticket (same as `client`)."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/tickets/{id}",
                "args": {
                    "id": "path",
                    "messages_limit": "query"
                }
            }
        },
        {
            "name": "tickets_reply",
            "capability": "tickets.reply",
            "title": "Reply to ticket",
            "description": "Replies to a support ticket and SENDS the reply by email to the external requester (through the ticket's mailbox). The body is rich HTML, sanitised server-side before store. A retry with the same Idempotency-Key never sends a second email.",
            "scope": "tickets:reply",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Ticket id (must be visible via the mailbox ACL).",
                        "examples": [
                            4321
                        ]
                    },
                    "body_html": {
                        "type": "string",
                        "minLength": 1,
                        "description": "The reply, rich HTML (as TinyMCE produces). Server-side HTMLPurifier-cleaned before store and before sending. At most 100000 characters; rejected if it sanitises to nothing.",
                        "examples": [
                            "<p>Köszönjük megkeresését, csatoltan küldjük a választ.</p>"
                        ]
                    },
                    "cc": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "description": "An email address."
                        },
                        "maxItems": 10,
                        "description": "Extra Cc recipients (at most 10). The requester and the mailbox are excluded automatically; an invalid address answers 422."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ],
                        "description": "Ticket status to set after replying (default \"pending\" = waiting for the requester). Records a status-change event.",
                        "default": "pending"
                    },
                    "append_signature": {
                        "type": "boolean",
                        "description": "Append the key user's saved ticket signature to the OUTGOING mail only (never stored in the thread).",
                        "default": false
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "body_html"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "ticket_id": {
                        "type": "integer",
                        "examples": [
                            4321
                        ]
                    },
                    "message_id": {
                        "type": "integer",
                        "description": "Id of the created outbound ticket_messages row.",
                        "examples": [
                            98765
                        ]
                    },
                    "direction": {
                        "type": "string",
                        "description": "Always \"out\"."
                    },
                    "sent_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "pending",
                            "sent",
                            "failed",
                            "scheduled",
                            null
                        ],
                        "description": "\"pending\" at create time; the async send flips it to sent/failed later."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ],
                        "description": "The ticket status after the reply."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when the reply was created through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/tickets/{id}/reply",
                "args": {
                    "id": "path",
                    "body_html": "body",
                    "cc": "body",
                    "status": "body",
                    "append_signature": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        },
        {
            "name": "tickets_update_status",
            "capability": "tickets.update_status",
            "title": "Change ticket status",
            "description": "Changes a ticket's status (new, open, pending or closed). \"closed\" stamps closed_at; any other status clears it. Pass expected_updated_at from your last read; a conflicting change answers 409. Answers 404 when the ticket is not visible.",
            "scope": "tickets:update",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Id of the record to modify."
                    },
                    "expected_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "The `updated_at` value from your most recent read of this record (required whenever the record has one). If the record changed since (a colleague edited it), the API answers 409 and you must re-read before retrying. A legacy record whose `updated_at` is null takes null."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ],
                        "description": "The new status. \"closed\" stamps closed_at; any other status clears it.",
                        "examples": [
                            "open"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "status"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Ticket id (use with tickets.get / tickets.update).",
                        "examples": [
                            4321
                        ]
                    },
                    "ticket_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Human ticket number, e.g. FLW-000123."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "pending",
                            "closed"
                        ]
                    },
                    "priority": {
                        "type": "string",
                        "enum": [
                            "low",
                            "normal",
                            "high"
                        ]
                    },
                    "mailbox": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "display_name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The mailbox the ticket arrived through (central registry)."
                    },
                    "requester": {
                        "type": "object",
                        "properties": {
                            "email": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The external person who wrote in."
                    },
                    "assigned_to": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "additionalProperties": false,
                        "description": "The colleague the ticket is assigned to, or null when unassigned."
                    },
                    "matter": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter linked to the ticket, or null."
                    },
                    "client": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The client linked to the ticket, or null."
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Time of the most recent thread activity; the list is ordered by this, newest first."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Pass this to tickets.update as expected_updated_at."
                    },
                    "created_via_api": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "key",
                                    "oauth"
                                ],
                                "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                            },
                            "key_id": {
                                "type": "integer",
                                "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                            },
                            "key_name": {
                                "type": "string",
                                "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                            },
                            "user_id": {
                                "type": "integer"
                            },
                            "user": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Present when the ticket was created through this API."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": true,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "PATCH",
                "path": "/tickets/{id}",
                "args": {
                    "id": "path",
                    "expected_updated_at": "body",
                    "status": "body"
                }
            }
        },
        {
            "name": "portal_threads_list",
            "capability": "portal.threads.list",
            "title": "List client portals",
            "description": "Lists the client portals (threads) the user may access: the matter, the client-side participants, the message and participant counts and the last message time, newest first. Optionally filtered to one matter (matter_id). A matter has at most one portal. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "portal:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "matter_id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Only the portal of this matter (404 matter_not_visible when the matter is not visible). A matter has at most one portal.",
                        "examples": [
                            1234
                        ]
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Portal (thread) id - the handle for portal.messages.list and portal.reply.",
                        "examples": [
                            57
                        ]
                    },
                    "matter": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "case_number": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "The matter (case) the portal belongs to."
                    },
                    "client_participants": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "client",
                                        "contact",
                                        "email"
                                    ],
                                    "description": "client = a principal, contact = a client contact, email = a legacy e-mail-only grant."
                                }
                            },
                            "additionalProperties": false
                        },
                        "description": "The external client-side participants the firm is talking to."
                    },
                    "participant_count": {
                        "type": "integer",
                        "description": "Number of live participants (staff and client)."
                    },
                    "message_count": {
                        "type": "integer",
                        "description": "Number of non-deleted messages in the thread."
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the newest non-deleted message was posted, ISO 8601 in the office zone; null for an empty thread."
                    },
                    "unread_for_me": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Unread messages for the acting user's own participant row; null when the acting user is not a participant of this portal."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/portals",
                "args": {
                    "matter_id": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "portal_messages_list",
            "capability": "portal.messages.list",
            "title": "List portal messages",
            "description": "Lists the messages of a client portal thread, oldest first, with the author (staff or client), the plain-text body and any attachment metadata. Answers 404 when the portal does not exist or is not accessible. Does not mark messages as read. Paginated: pass `limit`/`offset`; the result carries `pagination.total`, use offset + limit for the next page.",
            "scope": "portal:read",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Portal id (must be accessible).",
                        "examples": [
                            57
                        ]
                    },
                    "include_deleted": {
                        "type": "boolean",
                        "description": "Include deleted messages (their body is blanked). Default false.",
                        "default": false
                    },
                    "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Page size, 1-100. Default 25.",
                        "examples": [
                            25
                        ],
                        "default": 25
                    },
                    "offset": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Number of records to skip. Use offset + limit of the previous page to get the next one; `pagination.total` is the full count.",
                        "examples": [
                            0
                        ],
                        "default": 0
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "portal_messages.id.",
                        "examples": [
                            8012
                        ]
                    },
                    "author": {
                        "type": "object",
                        "properties": {
                            "participant_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "staff",
                                    "client"
                                ],
                                "description": "staff = a colleague of the firm, client = the external client."
                            }
                        },
                        "additionalProperties": false,
                        "description": "Who wrote the message."
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "from_firm",
                            "from_client"
                        ],
                        "description": "from_firm = a staff author, from_client = the external client."
                    },
                    "body": {
                        "type": "string",
                        "description": "The message as plain text (<br> decoded to line breaks). Empty string for a deleted message."
                    },
                    "attachment": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "portal_document_id": {
                                "type": "integer"
                            },
                            "file_name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false,
                        "description": "Attachment metadata when the message has a document; downloading it is out of scope. Null when there is none."
                    },
                    "is_deleted": {
                        "type": "boolean"
                    },
                    "deleted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When the message was posted, ISO 8601 in the office zone."
                    }
                },
                "additionalProperties": false
            },
            "is_list": true,
            "annotations": {
                "read_only_hint": true,
                "destructive_hint": false,
                "idempotent_hint": true
            },
            "x-http": {
                "method": "GET",
                "path": "/portals/{id}/messages",
                "args": {
                    "id": "path",
                    "include_deleted": "query",
                    "limit": "query",
                    "offset": "query"
                }
            }
        },
        {
            "name": "portal_reply",
            "capability": "portal.reply",
            "title": "Reply in client portal",
            "description": "Posts a staff reply in a client portal thread. The client sees it in the portal and is notified by e-mail (a signed magic-link notice, not the text); colleagues get an in-app notice. Plain text, escaped on store. 404 when the portal is not accessible.",
            "scope": "portal:reply",
            "input_schema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Portal id to reply in (must be accessible).",
                        "examples": [
                            57
                        ]
                    },
                    "body": {
                        "type": "string",
                        "maxLength": 20000,
                        "minLength": 1,
                        "description": "The reply, plain text. Angle brackets are accepted and escaped on store. At most 20000 characters.",
                        "examples": [
                            "Tisztelt Ügyfelünk! A beadványt ma benyújtottuk."
                        ]
                    },
                    "idempotency_key": {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[A-Za-z0-9_\\-:.]{1,128}$",
                        "description": "Optional stable key for safe retries: the same value returns the record created the first time instead of creating another; different values always create different records. Without a key, an identical create repeated within 120 seconds returns the first record. Letters, digits, `_`, `-`, `:` or `.`, at most 128 characters.",
                        "examples": [
                            "b8f1c2e0-6f7a-4d2e-9c1b-2a3d4e5f6a7b"
                        ]
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "body"
                ]
            },
            "output_schema": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "examples": [
                                    8012
                                ]
                            },
                            "author": {
                                "type": "object",
                                "properties": {
                                    "participant_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "staff",
                                            "client"
                                        ],
                                        "description": "staff = a colleague of the firm, client = the external client."
                                    }
                                },
                                "additionalProperties": false,
                                "description": "The acting staff user who posted the reply."
                            },
                            "direction": {
                                "type": "string",
                                "enum": [
                                    "from_firm",
                                    "from_client"
                                ],
                                "description": "Always \"from_firm\" for a reply posted through this API."
                            },
                            "body": {
                                "type": "string",
                                "description": "The posted message as plain text."
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "portal": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "matter": {
                                        "type": "object",
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "case_number": {
                                                "type": "string"
                                            }
                                        },
                                        "additionalProperties": false
                                    }
                                },
                                "additionalProperties": false,
                                "description": "The portal (thread) and its matter the reply was posted in."
                            },
                            "created_via_api": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "key",
                                            "oauth"
                                        ],
                                        "description": "\"key\": created with a static API key; \"oauth\": created by an app connected through OAuth."
                                    },
                                    "key_id": {
                                        "type": "integer",
                                        "description": "Id of the API key (kind \"key\") or of the connected app (kind \"oauth\"); the two are numbered separately."
                                    },
                                    "key_name": {
                                        "type": "string",
                                        "description": "Name the user gave the API key, e.g. \"Grok integration\", or the connected app's name for kind \"oauth\", e.g. \"Claude\"."
                                    },
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "user": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    }
                                },
                                "additionalProperties": false,
                                "description": "Provenance of the message created through this API."
                            }
                        },
                        "additionalProperties": false,
                        "description": "The posted reply."
                    }
                },
                "additionalProperties": false
            },
            "is_list": false,
            "annotations": {
                "read_only_hint": false,
                "destructive_hint": false,
                "idempotent_hint": false
            },
            "x-http": {
                "method": "POST",
                "path": "/portals/{id}/messages",
                "args": {
                    "id": "path",
                    "body": "body",
                    "idempotency_key": "idempotency-header"
                }
            }
        }
    ]
}