Skip to main content
Glama

Add Connector

add_connector
Idempotent

Use this when you need to add a mate connector to a part. Durably insert <partBinding>.connector(name, { type, origin, axis?, normal? }) before the final top-level return. Use the part binding returned by add_part. Returns modified source plus diagnostics from re-evaluation. Side-effect-free.

Input Schema

NameRequiredDescriptionDefault
axisNoOptional [x, y, z] axis.
codeYesThe .kcad.ts source code.
nameYesConnector name unique within the part.
typeYes
normalNoOptional [x, y, z] normal.
originYesOrigin as [x, y, z] shorthand, or a structured ConnectorOrigin.
part_bindingYesJS identifier bound to an AssemblyPartRef, e.g. "basePart".

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / origin / oneOf
      Previous value: -[
      -  {
      -    "description": "[x, y, z] shorthand.",
      -    "items": {
      -      "type": "number"
      -    },
      -    "maxItems": 3,
      -    "minItems": 3,
      -    "type": "array"
      -  },
      -  {
      -    "description": "Explicit numeric origin.",
      -    "properties": {
      -      "kind": {
      -        "enum": [
      -          "vec3"
      -        ],
      -        "type": "string"
      -      },
      -      "value": {
      -        "items": {
      -          "type": "number"
      -        },
      -        "maxItems": 3,
      -        "minItems": 3,
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "Topology-derived origin.",
      -    "properties": {
      -      "kind": {
      -        "enum": [
      -          "topology"
      -        ],
      -        "type": "string"
      -      },
      -      "query": {
      -        "properties": {
      -          "kind": {
      -            "enum": [
      -              "face-center",
      -              "face-normal",
      -              "vertex",
      -              "edge-axis"
      -            ],
      -            "type": "string"
      -          },
      -          "name": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "kind",
      -          "name"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "query"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "description": "[x, y, z] shorthand.",
      +    "items": {
      +      "type": "number"
      +    },
      +    "maxItems": 3,
      +    "minItems": 3,
      +    "type": "array"
      +  },
      +  {
      +    "description": "Explicit numeric origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "vec3"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "items": {
      +          "type": "number"
      +        },
      +        "maxItems": 3,
      +        "minItems": 3,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Topology-derived origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "topology"
      +        ],
      +        "type": "string"
      +      },
      +      "query": {
      +        "properties": {
      +          "kind": {
      +            "enum": [
      +              "face-center",
      +              "face-normal",
      +              "vertex",
      +              "edge-axis",
      +              "hole-axis"
      +            ],
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "name"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "query"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "binding_name": {
      -    "description": "JS const name bound to the new construct (when one was created).",
      -    "type": "string"
      -  },
      -  "diagnostics": {
      -    "description": "Diagnostics from re-evaluating the modified source.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (present when ok is false).",
      -    "type": "string"
      -  },
      -  "new_code": {
      -    "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "description": "Whether the edit applied and re-evaluated cleanly.",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  3. Changed2 schema fields changed
    • changedInput schema / properties / origin / description
      Previous value: -"Origin as [x, y, z] shorthand or structured ConnectorOrigin."New value: +"Origin as [x, y, z] shorthand, or a structured ConnectorOrigin."
    • addedInput schema / properties / origin / oneOf
      Added value: +[
      +  {
      +    "description": "[x, y, z] shorthand.",
      +    "items": {
      +      "type": "number"
      +    },
      +    "maxItems": 3,
      +    "minItems": 3,
      +    "type": "array"
      +  },
      +  {
      +    "description": "Explicit numeric origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "vec3"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "items": {
      +          "type": "number"
      +        },
      +        "maxItems": 3,
      +        "minItems": 3,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Topology-derived origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "topology"
      +        ],
      +        "type": "string"
      +      },
      +      "query": {
      +        "properties": {
      +          "kind": {
      +            "enum": [
      +              "face-center",
      +              "face-normal",
      +              "vertex",
      +              "edge-axis"
      +            ],
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "name"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "query"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed2 schema fields changed
    • changedInput schema / properties / origin / description
      Previous value: -"Origin as [x, y, z] shorthand, or a structured ConnectorOrigin."New value: +"Origin as [x, y, z] shorthand or structured ConnectorOrigin."
    • removedInput schema / properties / origin / oneOf
      Removed value: -[
      -  {
      -    "description": "[x, y, z] shorthand.",
      -    "items": {
      -      "type": "number"
      -    },
      -    "maxItems": 3,
      -    "minItems": 3,
      -    "type": "array"
      -  },
      -  {
      -    "description": "Explicit numeric origin.",
      -    "properties": {
      -      "kind": {
      -        "enum": [
      -          "vec3"
      -        ],
      -        "type": "string"
      -      },
      -      "value": {
      -        "items": {
      -          "type": "number"
      -        },
      -        "maxItems": 3,
      -        "minItems": 3,
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "Topology-derived origin.",
      -    "properties": {
      -      "kind": {
      -        "enum": [
      -          "topology"
      -        ],
      -        "type": "string"
      -      },
      -      "query": {
      -        "properties": {
      -          "kind": {
      -            "enum": [
      -              "face-center",
      -              "face-normal",
      -              "vertex",
      -              "edge-axis"
      -            ],
      -            "type": "string"
      -          },
      -          "name": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "kind",
      -          "name"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "query"
      -    ],
      -    "type": "object"
      -  }
      -]
  5. Changed2 schema fields changed
    • changedInput schema / properties / origin / description
      Previous value: -"Origin as [x, y, z] shorthand or structured ConnectorOrigin."New value: +"Origin as [x, y, z] shorthand, or a structured ConnectorOrigin."
    • addedInput schema / properties / origin / oneOf
      Added value: +[
      +  {
      +    "description": "[x, y, z] shorthand.",
      +    "items": {
      +      "type": "number"
      +    },
      +    "maxItems": 3,
      +    "minItems": 3,
      +    "type": "array"
      +  },
      +  {
      +    "description": "Explicit numeric origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "vec3"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "items": {
      +          "type": "number"
      +        },
      +        "maxItems": 3,
      +        "minItems": 3,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Topology-derived origin.",
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "topology"
      +        ],
      +        "type": "string"
      +      },
      +      "query": {
      +        "properties": {
      +          "kind": {
      +            "enum": [
      +              "face-center",
      +              "face-normal",
      +              "vertex",
      +              "edge-axis"
      +            ],
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "name"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "query"
      +    ],
      +    "type": "object"
      +  }
      +]
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  7. Changed11 schema fields changed
    • removedInput schema / properties / assembly
      Removed value: -{
      -  "description": "Assembly name; defaults to the only/first assembly on the active session.",
      -  "type": "string"
      -}
    • changedInput schema / properties / axis / description
      Previous value: -"Optional [x, y, z] axis (axis connectors)."New value: +"Optional [x, y, z] axis."
    • addedInput schema / properties / axis / items
      Added value: +{
      +  "type": "number"
      +}
    • addedInput schema / properties / code
      Added value: +{
      +  "description": "The .kcad.ts source code.",
      +  "type": "string"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Connector name (unique within the part)."New value: +"Connector name unique within the part."
    • changedInput schema / properties / normal / description
      Previous value: -"Optional [x, y, z] normal (frame / planar connectors)."New value: +"Optional [x, y, z] normal."
    • addedInput schema / properties / normal / items
      Added value: +{
      +  "type": "number"
      +}
    • changedInput schema / properties / origin / description
      Previous value: -"Origin as [x, y, z] (vec3 shorthand), a structured ConnectorOrigin, or a @kc[<part>/face/<name>] topology ref string (face-center default; #normal modifier yields face-normal). @kc[<part>/edge/<name>] maps to edge-axis; @kc[<part>/vertex/<name>] maps to vertex."New value: +"Origin as [x, y, z] shorthand or structured ConnectorOrigin."
    • removedInput schema / properties / part
      Removed value: -{
      -  "description": "Part name declared via arm.part(name, ...).",
      -  "type": "string"
      -}
    • addedInput schema / properties / part_binding
      Added value: +{
      +  "description": "JS identifier bound to an AssemblyPartRef, e.g. \"basePart\".",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "part",
      -  "name",
      -  "type",
      -  "origin"
      -]New value: +[
      +  "code",
      +  "part_binding",
      +  "name",
      +  "type",
      +  "origin"
      +]
  8. Changed1 schema field changed
    • changedInput schema / properties / origin / description
      Previous value: -"Origin as [x, y, z] (vec3 shorthand) or a structured ConnectorOrigin."New value: +"Origin as [x, y, z] (vec3 shorthand), a structured ConnectorOrigin, or a @kc[<part>/face/<name>] topology ref string (face-center default; #normal modifier yields face-normal). @kc[<part>/edge/<name>] maps to edge-axis; @kc[<part>/vertex/<name>] maps to vertex."
  9. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already disclose that the tool is not read-only, is idempotent, and is non-destructive. The description adds useful behavioral detail—durable insertion into source, return of modified source plus re-evaluation diagnostics—but the final claim 'Side-effect-free' sits in tension with 'Durably insert' and readOnlyHint=false, which muddies rather than clarifies the mutation semantics.

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?

Four short sentences, front-loaded with the trigger condition and followed by the concrete insertion pattern, prerequisite, and return behavior. The 'Side-effect-free' sentence is questionable enough that it doesn't fully earn its place, keeping this from a 5.

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 tool with annotations, an output schema, and high schema coverage, this covers the essential call recipe: prerequisite binding, insertion location, and return shape. Missing are edge cases such as duplicate connector names or failure diagnostics, but the definition is sufficient for correct invocation.

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 coverage is 86%, so parameter documentation is already largely handled by the schema. The description only adds the relationship between part_binding and add_part, plus shows the optional axis/normal slots in the API signature; it does not explain connector type semantics or the topology-derived origin forms that the schema describes.

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?

States a specific verb and resource ('add a mate connector to a part') and even shows the exact API call to insert, so an agent knows precisely what code transformation results. It is distinguishable from siblings like add_part and add_mate because it names add_part only as a prerequisite.

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?

Explicitly states when to use it ('when you need to add a mate connector'), the required prerequisite ('Use the part binding returned by add_part'), and where the insertion must go ('before the final top-level return'). It does not name any alternative or exclusion case (e.g., add_mate vs. connector), 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.