Skip to main content
Glama
HiroakiKatoh

legal-impact-mapper

by HiroakiKatoh

Extract Fact Graph

extract_fact_graph

Convert legal documents into a structured fact graph with nodes and edges representing facts and dependencies, enabling impact analysis of changes.

Instructions

【いつ使う】法律文書テキストを初めてグラフ化するときのみ呼ぶ。同一文書に対して2回目以降は不要(内部でLLMを呼ぶため高コスト)。 【入力】text: 契約書・法律文書・事実関係の記述(最大50,000文字) 【出力】FactGraph: { nodes: FactNode[], edges: Edge[] }。各ノードはid/type/text/confidenceを持ち、競合解釈にはgroup_idが付与される。エッジはfrom/to/typeで依存関係を表す。 【注意】このgraphオブジェクトをそのまま後続の update_fact_classification と analyze_impact に渡すこと。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes構造化対象のテキスト(契約書、法律文書、事実関係の記述など)
Behavior4/5

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

No annotations exist, so description carries full burden. It discloses high cost due to LLM usage, the output structure (FactGraph with nodes/edges/confidence/group_id), and that it should be called once per document. Does not mention side effects or idempotency, but the core behavioral traits are transparent.

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?

Structured into sections (when to use, input, output, note). Every sentence provides essential information with no redundancy. Front-loaded with critical usage guidance.

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 no output schema, description adequately outlines output structure and interaction with siblings. Lacks details on error handling or behavior for exceeding character limit, but covers the main workflow sufficiently.

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 already describes 'text' parameter. Description adds value by specifying max 50,000 characters and acceptable content types (contracts, legal documents, factual relations), going beyond schema.

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 explicitly states 'extract fact graph from legal document text' and distinguishes from sibling tools by noting it is for first-time usage only, with the output passed to update_fact_classification and analyze_impact. The verb 'graph' and resource 'legal document text' are clear.

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?

Provides explicit when-to-use ('only when graphing for the first time'), why not to call again ('high cost from internal LLM'), and what to do with output ('pass directly to siblings'). No ambiguity about the intended workflow.

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

Install Server

Other Tools

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/HiroakiKatoh/legal-impact-mapper'

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