Skip to main content
Glama

Open Legal Data (Germany)

Get law section

get_law_section
Read-onlyIdempotent

Get the full text of a specific law section.

    Retrieve law text by book code and section number, or by law ID.
    For example, get_law_section(book_code="BGB", section="823") returns
    the text of section 823 of the German Civil Code.

    By default the complete, untruncated ``content`` is returned as plain
    text (HTML tags removed, entities decoded, whitespace normalized; one
    line per paragraph or list item). Set ``offset`` and/or ``length`` to
    get a ``snippet`` of that plain text instead (see get_case for the
    snippet fields and pagination via ``next_offset``).

    Args:
        book_code: Law book code (e.g. "BGB", "StGB", "GG").
        section: Section identifier. Accepts bare numbers ("823",
            "20", "16a") or prefixed forms ("§ 823", "§823",
            "Art. 14", "Art 14", "Artikel 1"). The prefix spelling
            does not have to match the book: "Art. 20", "Artikel 20"
            and "20" all find Art 20 GG. Only exact sections match,
            never a longer number that contains the input. The
            ``section`` field on the response is whatever the DB
            stores, which differs by book convention: BGB / StGB /
            ZPO etc. store ``§ N`` (e.g. ``"§ 823"``), article-based
            books store e.g. ``"Art 1"`` (GG) or ``"Art. 6"``
            (DSGVO).
        law_id: Direct law database ID (alternative to book_code+section).
        offset: Start position in plain-text characters (default 0).
        length: Number of plain-text characters to return. 0 (default)
            means "until the end". Leave both at 0 for the full content.
    

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_law_section"
  }
}

Input Schema

NameRequiredDescriptionDefault
law_idNo
lengthNo
offsetNo
sectionNo
book_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only/idempotent/closed-world, yet the description adds substantial behavior: content is returned as normalized plain text with HTML stripped, entities decoded, one line per paragraph; the default is untruncated; sections only match exactly, never a longer number containing the input; and the returned section string varies by book convention ("§ 823" vs "Art 1"). That is real context beyond the structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and example, then the return mode, then per-argument detail. It is longer than typical, and the offset/length semantics are stated twice (prose and Args), which is mild redundancy but justified by the 0% schema coverage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description still names the key return fields (content, snippet, next_offset, section) and explains pagination. It defers the actual snippet field list and next_offset mechanics to get_case, which is a small gap for an agent that must page through a long section.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds meaning beyond a 0%-coverage schema: section accepts bare ("823", "16a") and prefixed ("§ 823", "Art 14", "Artikel 1") forms regardless of book, and offset/length are plain-text character positions where length=0 means to the end. It maps the three identifier parameters against each other only loosely (law_id merely "alternative"), so the mutual-exclusivity/precedence rule is left implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Get the full text of a specific law section") and immediately grounds it with a concrete example call returning BGB §823. An agent can distinguish this single-section fetch from search_laws or get_cases_for_law without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Makes the two access paths explicit (book_code+section vs. law_id as an alternative) and tells the agent to leave offset/length at 0 for full content. It cross-references get_case for snippet fields, but never states when to prefer this over search_laws, so no true exclusion guidance is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.