Skip to main content
Glama

twining_add_relation

Adds or updates a relation between two knowledge graph entities. Resolves names or IDs and merges properties on duplicate edges, so you can establish or correct links without duplication.

Instructions

Add a relation between two knowledge graph entities. Source and target can be entity IDs or names. Returns an error for ambiguous name matches. Upsert semantics: re-adding the same (source, target, type) merges properties instead of duplicating the edge. Relations are provenance-marked: agent-typed edges get properties.origin "declared", auto-populated edges "derived", absent means legacy/unknown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesRelation type: "depends_on", "implements", "decided_by", "affects", "tested_by", "calls", "imports", "related_to"
sourceYesSource entity ID or name
targetYesTarget entity ID or name
propertiesNoKey-value properties for this relation (max 50 entries, values ≤1000 chars)
Behavior5/5

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

With no annotations, the description carries the full burden. It discloses upsert semantics (merging properties on re-add), provenance marking behavior (origin values), and error handling for ambiguous names. This is rich, useful behavioral transparency beyond the basic 'adds a relation'.

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 efficient—four sentences, each adding critical information. It is front-loaded with the main purpose and then covers edge cases and behavior. No wasted words.

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 the tool has no output schema and no annotations, the description covers input flexibility, error conditions, upsert semantics, and provenance. It does not explicitly describe the return value or side effects beyond property merging, but for a mutation tool this is sufficient and above the minimum viable bar.

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 coverage is 100%, so the schema already documents all parameters. The description adds extra meaning by explaining source/target can be IDs or names (already in schema), but focuses on upsert and provenance properties, which are not in the schema. This adds value beyond schema, justifying a 4 rather than baseline 3.

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 'Add a relation between two knowledge graph entities', a specific verb+resource+action. This clearly distinguishes it from sibling tools like twining_add_entity, which adds entities rather than relations.

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?

It provides clear context on when to use the tool (when adding a relation) and how to specify source/target (IDs or names). It also warns about ambiguous name matches, which acts as a usage caution. However, it does not explicitly contrast with alternatives or state when not to use it, so it stops short of a 5.

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/daveangulo/twining-mcp'

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