Skip to main content
Glama

Create or Update Shared API Contract

hub_create_contract

Create or revise a versioned shared contract, decision, pitfall, or guardrail with concurrency protection. Pass expected_revision to prevent overwriting concurrent edits.

Instructions

Create or revise a shared contract, decision, pitfall, or guardrail. Pass expected_revision to guard against concurrent edits.

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": {
      "title": "<title>",
      "content": "<content>"
    },
    "name": "hub_create_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoOptional existing contract ID to update.
kindNo
titleYesContract title.
statusNo
contentYesMarkdown/OpenAPI/TypeScript contract specification.
file_pathNoOptional workspace file path for this contract.
change_noteNoReason for this revision.
workspace_idNo
expected_revisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden; it does disclose two important behaviors that structured data cannot: the tool is an upsert (create OR revise) and it supports optimistic concurrency via expected_revision. It omits what happens on a revision mismatch, whether existing content is replaced or merged, whether status transitions are validated, and what the call returns (new id, revision number), leaving a mutation tool's failure modes undisclosed.

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?

Two short sentences with the primary action first and the safety-critical concurrency tip second. Every clause carries information and there is no filler or restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a 9-parameter mutation tool with no annotations and no output schema, so the description is the only place an agent can learn behavioral and return semantics. Given that complexity, two sentences covering only upsert-ness and concurrency guarding leave the status lifecycle, kind semantics, error behavior on revision conflict, and return payload entirely unaddressed.

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?

Schema description coverage is 56%, and the description adds real meaning for exactly the parameter the schema leaves bare: expected_revision is explained as a concurrency guard, which an agent could not infer from an integer with minimum 1. It adds nothing for the other undocumented params (kind, status, workspace_id) — notably the status enum values draft/aligned/implemented/verified and their ordering are never explained, and change_note's role in revision history is left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb+resource pair ('Create or revise a shared contract') and enumerates the artifact kinds it covers (contract, decision, pitfall, guardrail), so an agent can tell it apart from read-side siblings like hub_list_contracts or app_get_contract. It stops short of explicitly naming the sibling it supersedes for updates, so it is clear but not fully differentiated.

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 second sentence gives one concrete usage rule: pass expected_revision to guard against concurrent edits, which is real when-to-do guidance. However, it never states when to create versus update, when to reach for hub_list_contracts to find an existing id first, or when this tool is inappropriate (e.g., read-only inspection via app_get_contract). Usage is implied by the optional 'id' rather than explained.

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