Skip to main content
Glama

Create a relationship

create_relationship

Assert that two addresses name the same thing, or record a rejected candidate with a reason. Each end is an address — an entity and a path — and the two ends may sit in different datasources and answer in different shapes: a campaign identifier in a warehouse column and a campaign identifier inside a service's document are one relationship between two addresses. A foreign key is one instance of the same form, both ends in one datasource with a column's name as its path. Where both ends answer in rows in the same datasource the join is measured and its cardinality derived from source uniqueness: a declared key, or, on a table that declares none, values measured non-null and distinct against a unique target. A conflicting assertion is refused, except that N:1 may be stated where only measurement makes the source unique. If either column's values are withheld, nothing is joined and a stated cardinality is recorded as an unvalidated assertion; anywhere else nothing is joined, the relationship is recorded as asserted rather than validated, and the cardinality is the one you state. Calling this for a listed candidate that already has an unanswered relationship row confirms or rejects that row in place; a relationship that already carries an answer is changed with update_relationship using the returned relationship_id.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>",
      "target": "<target>"
    },
    "name": "create_relationship"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesThe first end: {entity, path, datasource_id?}. Entity to address: a table of rows or a document, named `schema.entity` (for example 'google_ads.campaign_status') or by its bare name when that is unambiguous in the datasource. Path to one field of that entity. For an entity that answers in rows this is a column's name ('status'); for one that answers with a document it is the projection path ('campaign.status', 'result.homes[].price'), and a path ending in '*' is an open region, classified as a unit. datasource_id defaults to the datasource this call targets.
targetYesThe second end, in the same form. Name datasource_id here to relate an address in another datasource.
rejectedNoRecord a considered rejection. True requires rejection_reason; false confirms using measured join statistics.
datasourceNoOptional datasource ID to target. Omit to use the project's configured default; required when the project has multiple datasources and no default is configured. Each datasource has its own SQL dialect: get_schema lists every datasource with its type, dialect and identifier quote, and every result carries datasource_type and dialect. A datasource that has not finished setup is refused with datasource_not_ready.
cardinalityNoOptional cardinality assertion (1:1 or N:1), which must match the measured result; N:1 is also accepted where only measured uniqueness, not a declared key, makes it 1:1.
rejection_reasonNoReason for rejecting the candidate; requires an explicit rejection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses validation behavior: when joins are measured, when conflicting assertions are refused, how withheld values produce an unvalidated assertion, and when a relationship is merely asserted rather than validated. The annotations already cover the read/write and destructive profile, and the description adds substantive operational context.

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 purpose is front-loaded and the dense length is mostly justified by the tool's complex validation and rejection semantics. It could be structured more clearly, since several rules are packed into long sentences, but most content earns its place.

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?

For a complex relationship-creation tool with nested address parameters and no output schema, the description covers validation, rejection, cardinality, datasource scope, and the update alternative well. It only lightly covers the return shape, mentioning the returned relationship_id without describing the full response, which keeps it from a 5.

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 baseline is 3, but the description adds semantic meaning about both ends being addresses, cross-datasource relationships, rejection semantics, and cardinality constraints including the N:1 exception. It does not fully redefine every parameter, but it meaningfully enriches how source, target, rejected, and cardinality should be understood.

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 states a specific action and resource: assert that two addresses name the same thing, or record a rejected candidate. It distinguishes this creation/assertion tool from update_relationship in the final sentence, so an agent can identify its role without opening sibling schemas.

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 gives explicit usage conditions: use this to assert a relationship, record a rejection with a reason, or confirm/reject an unanswered candidate row. It also names the alternative for relationships that already carry an answer: update_relationship using the returned relationship_id.

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