Skip to main content
Glama

Get Contract

get-contract
Read-onlyIdempotent

Returns the contract of a component or a foundation, as YAML: its API (props, slots and events), its DOM contract (element, role, states, keyboard and parts), its tokens, and every rule in its checklist, each with a stable ID (like button/keep-focus), a level (must or should), a scope (component, usage or both) and how to check it. It holds every requirement in a fraction of the page's length, and it's the same file as https://opencomponents.dev/raw/docs/.yaml.

WHEN TO USE: first, before you build, review or explain a component or its tokens. WHEN NOT TO USE: for some of the rules only (by scope, layer, level or check), use list-rules. For the reasoning or the examples behind a rule, use get-page with its sections.

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": {
      "component": "<component>"
    },
    "name": "get-contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
componentYesThe component or foundation, like button or design-tokens.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "field",
      -  "input",
      -  "popover",
      -  "radio-group",
      -  "select",
      -  "spinner",
      -  "switch",
      -  "tag-group",
      -  "tag",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "combobox",
      +  "dialog",
      +  "field",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "select",
      +  "spinner",
      +  "switch",
      +  "tag-group",
      +  "tag",
      +  "textarea",
      +  "tooltip"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "field",
      -  "input",
      -  "popover",
      -  "radio-group",
      -  "select",
      -  "spinner",
      -  "switch",
      -  "tag",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "field",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "select",
      +  "spinner",
      +  "switch",
      +  "tag-group",
      +  "tag",
      +  "textarea",
      +  "tooltip"
      +]
  3. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "field",
      -  "input",
      -  "popover",
      -  "radio-group",
      -  "select",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "field",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "select",
      +  "spinner",
      +  "switch",
      +  "tag",
      +  "textarea",
      +  "tooltip"
      +]
  4. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "field",
      -  "input",
      -  "popover",
      -  "radio-group",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "field",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "select",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  5. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "input",
      -  "popover",
      -  "radio-group",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "field",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  6. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "input",
      -  "radio-group",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "input",
      +  "popover",
      +  "radio-group",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  7. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "radio-group",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "input",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "input",
      +  "radio-group",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  8. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "card",
      -  "checkbox-group",
      -  "checkbox",
      -  "dialog",
      -  "input",
      -  "spinner",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "radio-group",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "input",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  9. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "card",
      -  "checkbox",
      -  "dialog",
      -  "switch",
      -  "textarea",
      -  "tooltip",
      -  "checkbox-group"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "card",
      +  "checkbox-group",
      +  "checkbox",
      +  "dialog",
      +  "input",
      +  "spinner",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  10. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "card",
      -  "checkbox",
      -  "switch",
      -  "textarea",
      -  "tooltip",
      -  "checkbox-group"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "card",
      +  "checkbox",
      +  "dialog",
      +  "switch",
      +  "textarea",
      +  "tooltip",
      +  "checkbox-group"
      +]
  11. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "card",
      -  "checkbox",
      -  "switch",
      -  "textarea",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "card",
      +  "checkbox",
      +  "switch",
      +  "textarea",
      +  "tooltip",
      +  "checkbox-group"
      +]
  12. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "card",
      -  "checkbox",
      -  "switch",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "card",
      +  "checkbox",
      +  "switch",
      +  "textarea",
      +  "tooltip"
      +]
  13. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "switch",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "card",
      +  "checkbox",
      +  "switch",
      +  "tooltip"
      +]
  14. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input",
      -  "tooltip"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "switch",
      +  "tooltip"
      +]
  15. Changed1 schema field changed
    • changedInput schema / properties / component / enum
      Previous value: -[
      -  "design-tokens",
      -  "button",
      -  "spinner",
      -  "input"
      -]New value: +[
      +  "design-tokens",
      +  "button",
      +  "spinner",
      +  "input",
      +  "tooltip"
      +]
  16. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description goes well beyond them by describing the return payload in detail: rule entries carry a stable ID (like button/keep-focus), a level (must or should), a scope (component, usage or both) and a check method. It also notes the response is byte-equivalent to the hosted raw YAML at https://opencomponents.dev/raw/docs/<path>.yaml, which tells an agent it can cite or diff against a canonical file.

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?

Front-loaded with the core action, then a clearly labeled WHEN TO USE / WHEN NOT TO USE block, which is easy to scan. The return-value sentence is a long run-on clause stack that could be trimmed, but every element it lists is genuinely part of the payload.

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

Completeness5/5

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

There is no output schema, so the description must carry the entire burden of explaining what comes back, and it does: payload shape, rule field semantics, and the canonical YAML equivalence. Combined with a single fully described enum parameter and complete safety annotations, an agent has everything needed to call it correctly.

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 100% and the single parameter is a closed enum of 18 component names, so the schema already fully specifies the input. The description's "like button or design-tokens" is illustrative but adds nothing beyond the enum values and their schema description, so baseline 3 applies.

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?

Uses a specific verb and resource ("Returns the contract of a component or a foundation, as YAML") and then enumerates the contents: API (props, slots, events), DOM contract (element, role, states, keyboard, parts), tokens, and checklist rules. It also distinguishes itself from siblings by naming list-rules and get-page for narrower needs.

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?

Both directions are explicit: "WHEN TO USE: first, before you build, review or explain a component or its tokens" and "WHEN NOT TO USE: for some of the rules only (by scope, layer, level or check), use list-rules. For the reasoning or the examples behind a rule, use get-page with its sections." Each exclusion routes to a concrete alternative with the condition that selects it.

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.