Skip to main content
Glama

detect_contradictions

Detect logical contradictions in knowledge structures by flagging mutually exclusive relations, multi-valued functional relations, and inference confidence conflicts. Ensures consistent, valid knowledge.

Instructions

Detect logical contradictions in a Knowledge Structure using the contradiction/conflict extension constraints. Supports three types of detection:

  • mutual_exclusion: Flags when the same source-target pair has both of two declared relation types.

  • functional_relation: Flags when a source has multiple targets via a declared single-valued relation type.

  • inference_confidence_conflict (see ADR-001): Flags when two or more active (non-superseded) InferenceStep objects share a 'conclusion' but disagree on 'confidence'. Reported at WARNING severity, not ERROR -- this is a resolvable belief conflict between agreeing inference paths, not a jointly-nonsensical relation pair. Mark a step no longer active with its own 'superseded_by' field, not by editing another step. Examples of contradiction rules:

  • MutualExclusionRule: {"identity": {"id": "rule-1", "type": "MutualExclusionRule", "name": "no-support-and-refute"}, "structure": {"relation_type_a": "supports", "relation_type_b": "refutes"}}. This flags when the SAME source-target pair has BOTH a 'supports' and a 'refutes' relation.

  • FunctionalRelationRule: {"identity": {"id": "rule-2", "type": "FunctionalRelationRule", "name": "single-orbit"}, "structure": {"relation_type": "orbits"}}. This flags when a single source has MORE THAN ONE target via 'orbits'. To use mutual_exclusion/functional_relation, ensure your structure contains MutualExclusionRule and/or FunctionalRelationRule objects. inference_confidence_conflict needs no rule object -- it applies to any InferenceStep objects present.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
json_dataNoOptional. JSON Knowledge Structure to check (if no session_id).
session_idNoOptional. Session whose structure to check for contradictions.
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses important behavioral traits: inference_confidence_conflict is reported at WARNING severity, not ERROR; it clarifies that it is a resolvable belief conflict; and it instructs how to properly mark steps inactive via 'superseded_by'. These details go beyond what would be expected in structured annotations.

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?

The description is lengthy but well-structured with clear sections: main purpose, detection types, examples, and practical usage notes. Each section adds value, though the example JSON snippets could be considered verbose. The front-loading of the core purpose is strong.

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?

The description covers the tool's complexity well, explaining three detection types, prerequisites, and even a specific ADR reference. However, since there is no output schema, the description does not explain what the tool returns (e.g., list of contradictions, their locations, severities). This is a notable gap for complete contextual understanding.

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 provides 100% coverage with descriptions for both json_data and session_id. The tool description does not add significant parameter-specific meaning; its examples and details focus on the detection behavior and rule configurations rather than the parameters themselves. Baseline 3 is appropriate given full schema coverage.

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's purpose with a specific verb ('Detect logical contradictions') and resource ('Knowledge Structure'), and elaborates with three distinct detection types. It distinguishes from siblings by detailing the specific contradiction rules and providing examples, making its unique function immediately apparent.

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?

The description provides rich usage context, including how to enable detection types (e.g., 'ensure your structure contains MutualExclusionRule and/or FunctionalRelationRule objects') and clarifying that inference_confidence_conflict needs no rule object. However, it does not explicitly compare to alternatives or state when not to use this tool, so it lacks explicit exclusions.

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/Deus-corp/cks-mcp'

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