{
  "tools": [
    {
      "name": "search_legal_sources",
      "title": "Search Laki.ai Finnish legal and tax sources",
      "description": "Discover Finnish statutes, case law, preparatory works, and administrative or tax guidance by legal concept, title, abbreviation, or section reference. Use several distinct queries for multi-issue questions and filters only when they improve precision. Results are candidate locators with ids, titles, source types, snippets, heading paths when available, and truncation guidance; call read_document before relying on or citing them.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "queries": {
            "type": "array",
            "description": "Free-text query strings used to search legal sources. Pass multiple distinct legal-concept queries in one call so Laki.ai can run them in parallel; results are returned per query.",
            "minItems": 1,
            "maxItems": 5,
            "items": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "type": {
            "type": "array",
            "description": "Optional source type filters. Omit or pass an empty array to search all source types. Supported values are statute, case_law, administrative_guidance, and preparatory_works. Note the returned sourceType differs for two filters: case_law results return sourceType \"judgment\", and preparatory_works results return sourceType \"government_proposal\".",
            "items": {
              "type": "string",
              "enum": [
                "statute",
                "case_law",
                "administrative_guidance",
                "preparatory_works"
              ]
            }
          },
          "mode": {
            "type": "string",
            "description": "How to search. hybrid (default) fuses keyword/full-text and semantic relevance and suits most discovery queries. fts prefers exact Finnish full-text and name matching, including quoted phrases, statute names, and section references. semantic runs only meaning-based vector search and is best when the exact wording is unknown. preparatory_works has no semantic index, so it returns nothing under semantic.",
            "enum": [
              "hybrid",
              "fts",
              "semantic"
            ]
          },
          "inForceOnly": {
            "type": "boolean",
            "description": "When true, return only statutes currently in force.",
            "default": false
          },
          "asOfDate": {
            "type": "string",
            "description": "Optional YYYY-MM-DD date. When provided, return the statute version in force on that date."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of results to return.",
            "minimum": 1,
            "maximum": 10,
            "default": 5
          }
        },
        "required": [
          "queries"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string",
                  "description": "Input query that produced this result group."
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Laki.ai source id at the most specific available precision; pass ids to read_document."
                      },
                      "title": {
                        "type": "string",
                        "description": "Display title of the source."
                      },
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "statute",
                          "administrative_guidance",
                          "judgment",
                          "government_proposal"
                        ],
                        "description": "Type of legal source."
                      },
                      "snippet": {
                        "type": "string",
                        "description": "Short result snippet."
                      },
                      "jurisdiction": {
                        "type": "string",
                        "description": "Jurisdiction code for this source, such as eu."
                      },
                      "category": {
                        "type": "string",
                        "description": "Jurisdiction-native source category, such as primary_law or secondary_legislation."
                      },
                      "documentType": {
                        "type": "string",
                        "description": "Jurisdiction-native document type, such as treaty, regulation, directive, or decision."
                      },
                      "language": {
                        "type": "string",
                        "description": "Three-letter source language code, such as eng."
                      },
                      "canonicalCitation": {
                        "type": "string",
                        "description": "Canonical human-readable citation for the source."
                      },
                      "canonicalUrl": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Canonical official source URL when available."
                      },
                      "version": {
                        "type": "object",
                        "description": "Canonical EU document-version identity.",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isLatest": {
                            "type": "boolean"
                          },
                          "consolidationDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "groupId",
                          "isLatest",
                          "consolidationDate"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "id",
                      "title",
                      "sourceType"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Legal source results for this input query."
                }
              },
              "required": [
                "query",
                "items"
              ],
              "additionalProperties": false
            },
            "description": "Legal source results returned by Laki.ai, grouped by input query."
          }
        },
        "required": [
          "results"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Search Laki.ai Finnish legal and tax sources",
        "readOnlyHint": true,
        "openWorldHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "read_document",
      "title": "Read Laki.ai legal source",
      "description": "Read one or more source, section, or content-block ids. For every statute-section read with related-source stubs enabled, always pass concise research context on that same call: either the user's question or another short statement of the legal issue and desired related-source angle. No context is retained between calls. Context may be omitted for whole-document reads or when includeRelatedSourceStubs is false. Successful documents include their id, title, source type, exact citation, complete blocks with ids and block citations, and optional related-source leads; per-id failures remain alongside successful reads. Prefer the most specific returned citation and copy it verbatim. Related-source records and search snippets are leads only: read their ids before relying on or citing them. Navigate a too_large document with get_table_of_contents or search_within_documents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "description": "Laki.ai source ids returned by search_legal_sources, read_document contentBlocks, or related-source stubs. Pass several ids in one call so Laki.ai can read them in parallel.",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "includeRelatedSourceStubs": {
            "type": "boolean",
            "description": "When true (default), include compact related-source stubs for statute section reads only. Set false to omit them for this read.",
            "default": true
          },
          "context": {
            "type": "string",
            "description": "Concise research context used only to determine which related-source leads are relevant for this call. For every statute-section read with includeRelatedSourceStubs enabled, always pass either the user's question or another short statement of the legal issue and desired related-source angle on that same call; no context is retained between calls. Omit only for reads that do not request related-source filtering.",
            "maxLength": 2000
          }
        },
        "required": [
          "ids"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Laki.ai source id that was read."
                },
                "citation": {
                  "type": "string",
                  "description": "Ready-to-cite Markdown link [legal citation](url) for this document. Cite it verbatim; for section-specific claims prefer the matching content block citation."
                },
                "title": {
                  "type": "string",
                  "description": "Human-readable document title."
                },
                "sourceType": {
                  "type": "string",
                  "enum": [
                    "statute",
                    "judgment",
                    "government_proposal",
                    "administrative_guidance",
                    "parliamentary_document"
                  ],
                  "description": "Type of legal source."
                },
                "contentBlocks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Stable section/content-block id for this content block."
                      },
                      "text": {
                        "type": "string",
                        "description": "Block text."
                      },
                      "citation": {
                        "type": "string",
                        "description": "Ready-to-cite Markdown link [legal citation](url) for this block. For section-specific claims cite this block link verbatim instead of the document link."
                      }
                    },
                    "required": [
                      "id",
                      "text"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Complete citation-friendly blocks from the read document. Use a block citation for claims grounded in that block; otherwise use the document citation."
                },
                "relatedSourceStubs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Laki.ai related-source id at the most specific available precision; pass ids to read_document."
                      },
                      "citation": {
                        "type": "string",
                        "description": "Ready-to-cite Markdown link [legal citation](url) for this related source. Cite it verbatim; do not reassemble or replace the link."
                      },
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "statute",
                          "judgment",
                          "government_proposal",
                          "administrative_guidance",
                          "parliamentary_document",
                          "eu_document",
                          "other"
                        ],
                        "description": "Machine-readable type of related legal source. Legal titles, citations, snippets, and headings remain in the source language."
                      },
                      "relationship": {
                        "type": "string",
                        "enum": [
                          "key_case_law",
                          "case_law_reference",
                          "key_statute_reference",
                          "statute_reference",
                          "administrative_guidance_reference",
                          "government_proposal_rationale",
                          "committee_report",
                          "parliamentary_reply",
                          "amending_act",
                          "eu_preparatory_work",
                          "same_act_reference",
                          "cross_act_reference",
                          "scope_or_purpose_section",
                          "definitions_section",
                          "reference",
                          "repeal",
                          "correspondence",
                          "document_link"
                        ],
                        "description": "Machine-readable relationship type describing why the source is related."
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "source_to_read_document",
                          "read_document_to_source"
                        ],
                        "description": "Directed relationship semantics: source_to_read_document means the related source points to, explains, or produced the read document; read_document_to_source means the read document points to the related source. Omitted for structural context probes such as scope/purpose and definitions sections."
                      },
                      "snippet": {
                        "type": "string",
                        "description": "Optional short snippet for this related-source lead. Pass id to read_document before relying on or citing it."
                      },
                      "titleHierarchy": {
                        "type": "string",
                        "description": "Optional heading path locating the related-source lead within its source document."
                      },
                      "priority": {
                        "type": "number",
                        "description": "Relative triage priority for this related source; lower is read-first. Statute cross-references and the section act scope/definition sections rank ahead of broader link-graph neighbours."
                      }
                    },
                    "required": [
                      "id",
                      "citation",
                      "sourceType"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Compact related-source records, included only for statute section reads. Each may carry a short snippet lead but never the full related-source text; read the source by its id before relying on or citing it."
                },
                "jurisdiction": {
                  "type": "string",
                  "description": "Jurisdiction code for this source, such as eu."
                },
                "category": {
                  "type": "string",
                  "description": "Jurisdiction-native source category, such as primary_law or secondary_legislation."
                },
                "documentType": {
                  "type": "string",
                  "description": "Jurisdiction-native document type, such as treaty, regulation, directive, or decision."
                },
                "language": {
                  "type": "string",
                  "description": "Three-letter source language code, such as eng."
                },
                "canonicalCitation": {
                  "type": "string",
                  "description": "Canonical human-readable citation for the source."
                },
                "canonicalUrl": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Canonical official source URL when available."
                },
                "version": {
                  "type": "object",
                  "description": "Canonical EU document-version identity.",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isLatest": {
                      "type": "boolean"
                    },
                    "consolidationDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "groupId",
                    "isLatest",
                    "consolidationDate"
                  ],
                  "additionalProperties": false
                },
                "titleHierarchy": {
                  "type": "array",
                  "description": "Heading path locating the requested block.",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "citation",
                "title",
                "sourceType",
                "contentBlocks"
              ],
              "additionalProperties": false
            },
            "description": "Documents successfully read by Laki.ai, grouped by requested id."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Requested Laki.ai source id that failed to read."
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "not_found",
                    "unsupported",
                    "too_large",
                    "missing_context"
                  ],
                  "description": "not_found / unsupported: a requested id could not be read. too_large: the document exceeds the read_document size limit; navigate within it (search_within_documents / get_table_of_contents) and read specific section ids instead. missing_context: non-fatal advisory (no failing id) that no context was available to filter related sources."
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable detail for actionable failures or advisory reasons, such as too_large or missing_context."
                }
              },
              "required": [
                "reason"
              ],
              "additionalProperties": false
            },
            "description": "Per-id read failures for requested ids that could not be read."
          }
        },
        "required": [
          "documents",
          "errors"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Read Laki.ai legal source",
        "readOnlyHint": true,
        "openWorldHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "get_statute_section_history",
      "title": "Get statute section version history",
      "description": "Trace one Finnish statute section across versions. Returns the statute and section identity, version-specific section ids and citations, in-force dates, text when available, amending statutes, preparatory works, rationale leads, and paging state. Use it for temporal questions or amendment provenance, read linked source ids for deeper evidence, and state gaps when a historical text is unavailable.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Statute section content-block id from search_legal_sources or read_document, e.g. act_sc_2006-624_2025-0561__chp_22__sec_1.",
            "maxLength": 256
          },
          "startFromIndex": {
            "type": "integer",
            "description": "Zero-based index into the genuine section-change history. Omit or pass 0 for the latest changes.",
            "minimum": 0,
            "default": 0
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "statute": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Top-level consolidated statute id."
              },
              "title": {
                "type": "string",
                "description": "Human-readable statute title."
              },
              "citation": {
                "type": "string",
                "description": "Ready-to-cite Markdown link [legal citation](url) for the statute. Cite it verbatim."
              },
              "part": {
                "type": "string",
                "description": "Part number when present in the section id."
              },
              "chapter": {
                "type": "string",
                "description": "Chapter number when present in the section id."
              },
              "section": {
                "type": "string",
                "description": "Section number from the requested id."
              }
            },
            "required": [
              "id",
              "title",
              "citation",
              "section"
            ],
            "additionalProperties": false,
            "description": "Requested statute section target."
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "inForceFrom": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "ISO YYYY-MM-DD date when this statute version entered into force."
                },
                "sectionText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Section text as it appeared in this version, when available."
                },
                "sectionId": {
                  "type": "string",
                  "description": "Version-specific statute section content-block id."
                },
                "citation": {
                  "type": "string",
                  "description": "Ready-to-cite Markdown link [legal citation](url) for the version-specific section. Cite it verbatim."
                },
                "relationType": {
                  "type": "string",
                  "enum": [
                    "original",
                    "amendment"
                  ],
                  "description": "Whether this text came from the original statute or an amendment."
                },
                "amendingStatute": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Laki.ai source id when available."
                        },
                        "title": {
                          "type": "string",
                          "description": "Human-readable source title."
                        },
                        "citation": {
                          "type": "string",
                          "description": "Ready-to-cite Markdown link [legal citation](url) when the source is linkable. Cite it verbatim."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Statute that introduced or amended this section text."
                },
                "preliminaryWorks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "government_proposal",
                          "parliamentary_document"
                        ],
                        "description": "Type of preliminary work source."
                      },
                      "id": {
                        "type": "string",
                        "description": "Laki.ai source id when available."
                      },
                      "title": {
                        "type": "string",
                        "description": "Human-readable preliminary work title."
                      },
                      "citation": {
                        "type": "string",
                        "description": "Ready-to-cite Markdown link [legal citation](url) when the source is linkable. Cite it verbatim."
                      },
                      "rationaleSnippet": {
                        "type": "string",
                        "description": "Per-section rationale snippet from the HE when available."
                      },
                      "rationaleSnippetId": {
                        "type": "string",
                        "description": "Readable HE rationale block id that produced rationaleSnippet; pass to read_document for deeper rationale context."
                      }
                    },
                    "required": [
                      "sourceType",
                      "title"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Preliminary works linked to this section version."
                }
              },
              "required": [
                "inForceFrom",
                "sectionText",
                "sectionId",
                "citation",
                "relationType",
                "amendingStatute",
                "preliminaryWorks"
              ],
              "additionalProperties": false
            },
            "description": "Newest-first section source amendments and text changes."
          },
          "startFromIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "returnedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "nextStartFromIndex": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "scanTruncated": {
            "type": "boolean"
          }
        },
        "required": [
          "statute",
          "versions",
          "startFromIndex",
          "returnedCount",
          "nextStartFromIndex",
          "hasMore",
          "scanTruncated"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Get statute section version history",
        "readOnlyHint": true,
        "openWorldHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "get_table_of_contents",
      "title": "Get table of contents for Laki.ai legal sources",
      "description": "Navigate one or more already-identified sources by nested heading and section ids. The requested depth caps the returned outline and the result states that deeper entries may be omitted. Returned ids are locators, not evidence; pass the relevant ids to read_document before relying on or citing them.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "description": "One or more already-identified Laki.ai ids returned by search_legal_sources, read_document, related-source stubs, or another in-document navigation tool. Pass ids to read_document before relying on locator-only results.",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "depth": {
            "type": "integer",
            "description": "Maximum nested outline depth to return. Default 2. Use higher values only when deeper nested structure is needed.",
            "minimum": 1,
            "maximum": 6,
            "default": 2
          }
        },
        "required": [
          "ids"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "description": "Structural outlines for the requested documents.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Top-level Laki.ai source id for the listed outline."
                },
                "title": {
                  "type": "string",
                  "description": "Human-readable document title."
                },
                "sourceType": {
                  "type": "string",
                  "description": "Type of legal source.",
                  "enum": [
                    "statute",
                    "judgment",
                    "government_proposal",
                    "administrative_guidance",
                    "parliamentary_document"
                  ]
                },
                "sections": {
                  "type": "array",
                  "description": "Hierarchical section/heading locators.",
                  "items": {
                    "type": "object",
                    "description": "A document section/heading locator.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Section/content-block ID that can be passed to read_document."
                      },
                      "heading": {
                        "type": "string",
                        "description": "Section heading."
                      },
                      "level": {
                        "type": "number",
                        "description": "Heading level."
                      },
                      "children": {
                        "type": "array",
                        "description": "Nested child sections.",
                        "items": {
                          "type": "object",
                          "description": "A document section/heading locator.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Section/content-block ID that can be passed to read_document."
                            },
                            "heading": {
                              "type": "string",
                              "description": "Section heading."
                            },
                            "level": {
                              "type": "number",
                              "description": "Heading level."
                            },
                            "children": {
                              "type": "array",
                              "description": "Nested child sections.",
                              "items": {
                                "type": "object",
                                "description": "A document section/heading locator.",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Section/content-block ID that can be passed to read_document."
                                  },
                                  "heading": {
                                    "type": "string",
                                    "description": "Section heading."
                                  },
                                  "level": {
                                    "type": "number",
                                    "description": "Heading level."
                                  },
                                  "children": {
                                    "type": "array",
                                    "description": "Nested child sections.",
                                    "items": {
                                      "type": "object",
                                      "description": "A document section/heading locator.",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "description": "Section/content-block ID that can be passed to read_document."
                                        },
                                        "heading": {
                                          "type": "string",
                                          "description": "Section heading."
                                        },
                                        "level": {
                                          "type": "number",
                                          "description": "Heading level."
                                        },
                                        "children": {
                                          "type": "array",
                                          "description": "Nested child sections.",
                                          "items": {
                                            "type": "object",
                                            "description": "A document section/heading locator.",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "description": "Section/content-block ID that can be passed to read_document."
                                              },
                                              "heading": {
                                                "type": "string",
                                                "description": "Section heading."
                                              },
                                              "level": {
                                                "type": "number",
                                                "description": "Heading level."
                                              },
                                              "children": {
                                                "type": "array",
                                                "description": "Nested child sections.",
                                                "items": {
                                                  "type": "object",
                                                  "description": "A document section/heading locator.",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "description": "Section/content-block ID that can be passed to read_document."
                                                    },
                                                    "heading": {
                                                      "type": "string",
                                                      "description": "Section heading."
                                                    },
                                                    "level": {
                                                      "type": "number",
                                                      "description": "Heading level."
                                                    },
                                                    "children": {
                                                      "type": "array",
                                                      "description": "Nested child sections.",
                                                      "items": {
                                                        "type": "object",
                                                        "description": "A document section/heading locator.",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "description": "Section/content-block ID that can be passed to read_document."
                                                          },
                                                          "heading": {
                                                            "type": "string",
                                                            "description": "Section heading."
                                                          },
                                                          "level": {
                                                            "type": "number",
                                                            "description": "Heading level."
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "heading",
                                                          "level"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "heading",
                                                    "level"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "heading",
                                              "level"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "heading",
                                        "level"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "heading",
                                  "level"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "id",
                            "heading",
                            "level"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "id",
                      "heading",
                      "level"
                    ],
                    "additionalProperties": false
                  }
                },
                "totalSections": {
                  "type": "integer",
                  "description": "Total number of returned section entries."
                }
              },
              "required": [
                "id",
                "title",
                "sourceType",
                "sections",
                "totalSections"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "documents"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Get table of contents for Laki.ai legal sources",
        "readOnlyHint": true,
        "openWorldHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "search_within_documents",
      "title": "Search inside Laki.ai legal sources",
      "description": "Search only inside supplied source ids. Hybrid combines full-text and semantic matching, fts suits exact Finnish terms and section references, and semantic suits conceptual passages. Results retain document identity, readable match ids, snippets or section keys, scores, embedding activity, and an explicit truncation flag. Matches are locators, not evidence; read returned ids before relying on or citing them.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "description": "One or more already-identified Laki.ai ids returned by search_legal_sources, read_document, related-source stubs, or another in-document navigation tool. Pass ids to read_document before relying on locator-only results.",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 256
            }
          },
          "query": {
            "type": "string",
            "description": "Search text. Use natural-language concepts for semantic or hybrid mode and Finnish full-text terms for fts. Pure semantic mode accepts at most 200 characters; fts and hybrid accept at most 500, and hybrid uses the first 200 for its semantic leg.",
            "maxLength": 500
          },
          "mode": {
            "type": "string",
            "description": "How to search within the supplied documents. hybrid (default) fuses full-text and semantic relevance and suits most queries. fts is Finnish full-text over the document text — best for exact terms and section references. semantic is meaning-based — best when the exact wording is unknown.",
            "enum": [
              "hybrid",
              "fts",
              "semantic"
            ]
          }
        },
        "required": [
          "ids",
          "query"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "matches": {
            "type": "array",
            "description": "Matching in-document locators, ranked fts then semantic. Pass id to read_document before relying on a passage.",
            "items": {
              "type": "object",
              "properties": {
                "documentType": {
                  "type": "string",
                  "description": "Type of legal source containing the locator.",
                  "enum": [
                    "statute",
                    "judgment",
                    "government_proposal",
                    "administrative_guidance",
                    "parliamentary_document"
                  ]
                },
                "documentTitle": {
                  "type": "string",
                  "description": "Human-readable document title."
                },
                "id": {
                  "type": "string",
                  "description": "Stable section/content-block id that can be passed to read_document."
                },
                "matchType": {
                  "type": "string",
                  "description": "Which strategy produced this match: fts (full-text) or semantic.",
                  "enum": [
                    "fts",
                    "semantic"
                  ]
                },
                "context": {
                  "type": "string",
                  "description": "Short text snippet around the match (fts matches)."
                },
                "sectionKey": {
                  "type": "string",
                  "description": "Embedding section key resolved to id (semantic matches)."
                },
                "score": {
                  "type": "number",
                  "description": "Relevance score: full-text rank (fts) or vector similarity (semantic)."
                }
              },
              "required": [
                "documentType",
                "documentTitle",
                "id",
                "matchType"
              ],
              "additionalProperties": false
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether additional grep/fts matches were omitted because the result cap was reached."
          },
          "embeddingTriggered": {
            "type": "array",
            "description": "Top-level ids for which on-demand embedding was generated during the call.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "matches",
          "truncated",
          "embeddingTriggered"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Search inside Laki.ai legal sources",
        "readOnlyHint": true,
        "openWorldHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "get_source_coverage",
      "title": "Get source coverage",
      "description": "Describe which Finnish and EU legal sources are currently searchable in Laki.ai MCP, which important sources are not yet searchable, and how to find the available material.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "coverage": {
            "type": "string"
          }
        },
        "required": [
          "coverage"
        ],
        "additionalProperties": false
      },
      "securitySchemes": [
        {
          "type": "oauth2",
          "scopes": [
            "legal_sources:search"
          ]
        }
      ],
      "_meta": {
        "securitySchemes": [
          {
            "type": "oauth2",
            "scopes": [
              "legal_sources:search"
            ]
          }
        ]
      },
      "annotations": {
        "title": "Get source coverage",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": false
      }
    }
  ]
}
