Skip to main content
Glama
omarnagy91
by omarnagy91

segment_clauses

Segment contracts into numbered clauses and headings with stable anchors across English and Arabic numbering styles. Produces citable references for finding exact clauses.

Instructions

Split the document into numbered clauses and headings, handling English and Arabic numbering conventions. English decimal (1, 1.1, 1.1.1), lettered and roman sub items, and the Arabic conventions المادة (٣), البند الأول, standalone ordinals أولاً and ثانياً, and Arabic decimal ٣-٢ written with a hyphen. Each clause gets a stable anchor such as "C14", its label exactly as the document writes it, an ASCII normalised label for comparison, its nesting depth, its parent clause, and the paragraph anchors it covers. Cite these anchors so the reader can find the exact clause.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the document. Accepts .pdf, .docx or a plain text file (.txt, .md). Absolute paths are safest. The format is detected from the file content, not the extension.
maxClausesNoReturn at most this many clauses. Omit for all of them.
includeTextNoInclude each clause full text. Default true.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly discloses that the tool handles English and Arabic numbering schemes, produces normalized labels, preserves the document's original labels, and returns parent/child relationships. It does not mention error behavior or performance limits, but the extraction behavior is well specified.

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 dense but every sentence adds value: the first sentence states the core action, the second enumerates the numbering conventions, and the third lists the output fields and their purpose. It is front-loaded with the primary behavior and avoids filler.

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?

Given there is no output schema, the description adequately explains the return fields (anchor, label, depth, parent, paragraph anchors) and the complexity of the numbering conventions. It falls slightly short of 5 because it does not explicitly state the return container format (e.g., list of clause objects) or any failure modes, but these are reasonably inferable.

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

Parameters3/5

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

The input schema already covers all three parameters with descriptions at 100% coverage, so the baseline is 3. The tool description adds no parameter-level detail beyond the schema, but it does not need to because the schema is complete.

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 opens with a specific verb and resource: 'Split the document into numbered clauses and headings.' It then details the exact output fields (stable anchor, label, depth, parent, paragraph anchors), making the tool's purpose unmistakable and distinct from siblings like extract_dates or extract_parties.

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

Usage Guidelines3/5

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

The intended use is implied by the final sentence, 'Cite these anchors so the reader can find the exact clause,' and by the focus on numbering conventions. However, there is no explicit guidance about when to prefer this tool over find_clauses or other siblings, and no exclusion criteria.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/omarnagy91/legal-intake-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server