Skip to main content
Glama

Get Surrounding Provisions

legal_get_context
Read-onlyIdempotent

Get a stored text section and its neighbours in document order, including consecutive provisions, parts of a long provision or sections of a court decision. Serves questions that span consecutive provisions or need the surrounding context of a norm's scope.

Requires a norm_id from legal_search, legal_lookup or legal_get_toc. Returns target, before and after sections, with up to 10 neighbours in each direction. Each section's id is a valid norm_id for a subsequent call. A window may cross provision boundaries; norm_key identifies which provision each section belongs to. legal_get_toc gives the law-wide overview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoNumber of stored text sections after the target (max 10).
beforeNoNumber of stored text sections before the target (max 10).
norm_idYesnorm_id from legal_search, legal_lookup or legal_get_toc, or a section's id from legal_get_context.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / after / description
      Previous value: -"Number of norms after the target (max 10)."New value: +"Number of stored text sections after the target (max 10)."
    • changedInput schema / properties / before / description
      Previous value: -"Number of norms before the target (max 10)."New value: +"Number of stored text sections before the target (max 10)."
    • changedInput schema / properties / norm_id / description
      Previous value: -"norm_id from a prior legal_search or legal_lookup result."New value: +"norm_id from legal_search, legal_lookup or legal_get_toc, or a section's id from legal_get_context."
  2. Changed2 schema fields changed
    • addedInput schema / properties / norm_id / description
      Added value: +"norm_id from a prior legal_search or legal_lookup result."
    • addedInput schema / properties / norm_id / minimum
      Added value: +1
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses return structure (target, before, after sections with up to 10 neighbors each), that windows may cross provision boundaries, and that section IDs can be reused as norm_ids. These are valuable behavioral details not derivable from annotations.

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

Conciseness5/5

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

The description is two tight paragraphs with the core purpose front-loaded, followed by usage and return details. Every sentence adds value, with no redundancy or filler.

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

Completeness5/5

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

The description, combined with the output schema and annotations, fully equips an agent to call the tool correctly: it covers input requirements, output structure, boundary-crossing behavior, and ID reuse. Nothing essential is missing.

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?

Schema descriptions cover all parameters (100% coverage). The description adds context about norm_id's provenance and reuse, enhancing the schema's meaning. However, after/before parameters are not further elaborated, so a 4 is appropriate given the high baseline.

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?

The description clearly states the tool retrieves a stored text section and its neighbors in document order, explicitly covering consecutive provisions and court decision sections. It distinguishes itself from siblings by emphasizing context retrieval, which is unique among the listed tools.

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

Usage Guidelines5/5

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

It explicitly states when to use: for questions spanning consecutive provisions or needing surrounding context. It also specifies the required input source (norm_id from legal_search, legal_lookup, or legal_get_toc) and contrasts with legal_get_toc for law-wide overviews, effectively guiding tool selection.

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.

Resources