Skip to main content
Glama

Solve Sketch

solve_sketch
Read-only

Use this when you need to solve a 2D sketch constraint set. Solve a 2D sketch constraint set. Side-effect-free: pass { entities, constraints } and receive solved entities plus the original constraints. Entities are POINT, LINE, and CIRCLE records; constraints use the kernelCAD constraint vocabulary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYesSketch entities to solve. Lines reference point ids; circles reference a center point id.
constraintsYesConstraints to apply to the entities.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorsNoSolver/validation errors (present on failure, including non-convergence).
entitiesYesSolved sketch entities (best-effort on a non-converging solve).
residualNoFinal aggregate constraint residual when the solver ran.
convergedNoWhether the constraint solve converged below tolerance. ok is false when this is false.
constraintsYesThe constraints applied.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedOutput schema / properties / converged
      Added value: +{
      +  "description": "Whether the constraint solve converged below tolerance. ok is false when this is false.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / entities / description
      Previous value: -"Solved sketch entities."New value: +"Solved sketch entities (best-effort on a non-converging solve)."
    • changedOutput schema / properties / errors / description
      Previous value: -"Solver errors (present on failure)."New value: +"Solver/validation errors (present on failure, including non-convergence)."
    • addedOutput schema / properties / residual
      Added value: +{
      +  "description": "Final aggregate constraint residual when the solver ran.",
      +  "type": "number"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / constraints / items / properties
      Added value: +{
      +  "entities": {
      +    "description": "Ids of the entities the constraint relates.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "id": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "enum": [
      +      "COINCIDENT",
      +      "DISTANCE",
      +      "HORIZONTAL",
      +      "VERTICAL",
      +      "PARALLEL",
      +      "PERPENDICULAR",
      +      "EQUAL_LENGTH",
      +      "TANGENT",
      +      "RADIUS",
      +      "ANGLE",
      +      "CONCENTRIC",
      +      "SYMMETRIC"
      +    ],
      +    "type": "string"
      +  },
      +  "value": {
      +    "description": "Required for DISTANCE, RADIUS, and ANGLE.",
      +    "type": "number"
      +  }
      +}
    • addedInput schema / properties / constraints / items / required
      Added value: +[
      +  "id",
      +  "type",
      +  "entities"
      +]
    • addedInput schema / properties / entities / items / oneOf
      Added value: +[
      +  {
      +    "description": "POINT — a 2D point.",
      +    "properties": {
      +      "fixed": {
      +        "description": "If true, the solver won't move this point.",
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "POINT"
      +        ],
      +        "type": "string"
      +      },
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "x",
      +      "y"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "LINE — references two point ids.",
      +    "properties": {
      +      "id": {
      +        "type": "string"
      +      },
      +      "p1": {
      +        "type": "string"
      +      },
      +      "p2": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "LINE"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "p1",
      +      "p2"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "CIRCLE — references a center point id.",
      +    "properties": {
      +      "center": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "radius": {
      +        "type": "number"
      +      },
      +      "type": {
      +        "enum": [
      +          "CIRCLE"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "center",
      +      "radius"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / entities / items / type
      Removed value: -"object"
  3. Changed4 schema fields changed
    • removedInput schema / properties / constraints / items / properties
      Removed value: -{
      -  "entities": {
      -    "description": "Ids of the entities the constraint relates.",
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "id": {
      -    "type": "string"
      -  },
      -  "type": {
      -    "enum": [
      -      "COINCIDENT",
      -      "DISTANCE",
      -      "HORIZONTAL",
      -      "VERTICAL",
      -      "PARALLEL",
      -      "PERPENDICULAR",
      -      "EQUAL_LENGTH",
      -      "TANGENT",
      -      "RADIUS",
      -      "ANGLE",
      -      "CONCENTRIC",
      -      "SYMMETRIC"
      -    ],
      -    "type": "string"
      -  },
      -  "value": {
      -    "description": "Required for DISTANCE, RADIUS, and ANGLE.",
      -    "type": "number"
      -  }
      -}
    • removedInput schema / properties / constraints / items / required
      Removed value: -[
      -  "id",
      -  "type",
      -  "entities"
      -]
    • removedInput schema / properties / entities / items / oneOf
      Removed value: -[
      -  {
      -    "description": "POINT — a 2D point.",
      -    "properties": {
      -      "fixed": {
      -        "description": "If true, the solver won't move this point.",
      -        "type": "boolean"
      -      },
      -      "id": {
      -        "type": "string"
      -      },
      -      "type": {
      -        "enum": [
      -          "POINT"
      -        ],
      -        "type": "string"
      -      },
      -      "x": {
      -        "type": "number"
      -      },
      -      "y": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "type",
      -      "x",
      -      "y"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "LINE — references two point ids.",
      -    "properties": {
      -      "id": {
      -        "type": "string"
      -      },
      -      "p1": {
      -        "type": "string"
      -      },
      -      "p2": {
      -        "type": "string"
      -      },
      -      "type": {
      -        "enum": [
      -          "LINE"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "type",
      -      "p1",
      -      "p2"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "CIRCLE — references a center point id.",
      -    "properties": {
      -      "center": {
      -        "type": "string"
      -      },
      -      "id": {
      -        "type": "string"
      -      },
      -      "radius": {
      -        "type": "number"
      -      },
      -      "type": {
      -        "enum": [
      -          "CIRCLE"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "type",
      -      "center",
      -      "radius"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / entities / items / type
      Added value: +"object"
  4. Changed4 schema fields changed
    • addedInput schema / properties / constraints / items / properties
      Added value: +{
      +  "entities": {
      +    "description": "Ids of the entities the constraint relates.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "id": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "enum": [
      +      "COINCIDENT",
      +      "DISTANCE",
      +      "HORIZONTAL",
      +      "VERTICAL",
      +      "PARALLEL",
      +      "PERPENDICULAR",
      +      "EQUAL_LENGTH",
      +      "TANGENT",
      +      "RADIUS",
      +      "ANGLE",
      +      "CONCENTRIC",
      +      "SYMMETRIC"
      +    ],
      +    "type": "string"
      +  },
      +  "value": {
      +    "description": "Required for DISTANCE, RADIUS, and ANGLE.",
      +    "type": "number"
      +  }
      +}
    • addedInput schema / properties / constraints / items / required
      Added value: +[
      +  "id",
      +  "type",
      +  "entities"
      +]
    • addedInput schema / properties / entities / items / oneOf
      Added value: +[
      +  {
      +    "description": "POINT — a 2D point.",
      +    "properties": {
      +      "fixed": {
      +        "description": "If true, the solver won't move this point.",
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "POINT"
      +        ],
      +        "type": "string"
      +      },
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "x",
      +      "y"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "LINE — references two point ids.",
      +    "properties": {
      +      "id": {
      +        "type": "string"
      +      },
      +      "p1": {
      +        "type": "string"
      +      },
      +      "p2": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "LINE"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "p1",
      +      "p2"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "CIRCLE — references a center point id.",
      +    "properties": {
      +      "center": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "radius": {
      +        "type": "number"
      +      },
      +      "type": {
      +        "enum": [
      +          "CIRCLE"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "type",
      +      "center",
      +      "radius"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / entities / items / type
      Removed value: -"object"
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "constraints": {
      +      "description": "The constraints applied.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "entities": {
      +      "description": "Solved sketch entities.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "errors": {
      +      "description": "Solver errors (present on failure).",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "entities",
      +    "constraints"
      +  ],
      +  "type": "object"
      +}
  6. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds 'Side-effect-free: pass { entities, constraints } and receive solved entities plus the original constraints,' which clarifies the input/output contract and reinforces the read-only behavior. It also notes the 'kernelCAD constraint vocabulary,' adding useful context without contradicting annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short, but the first and second sentences redundantly say the same thing: 'Use this when you need to solve a 2D sketch constraint set' followed by 'Solve a 2D sketch constraint set.' One sentence could be removed to make it tighter, though the remaining content is efficient.

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?

With a rich input schema and an output schema present, the description need not explain return values in detail. It covers when to use the tool, the side-effect-free nature, and the entity/constraint input categories. This is complete enough for an agent to invoke the tool correctly; only minor details like the 'fixed' point behavior are left to the schema.

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%, with detailed descriptions for entity types, constraint types, and the 'fixed' flag. The description's mention of 'POINT, LINE, and CIRCLE records' and 'kernelCAD constraint vocabulary' mostly repeats what the schema already encodes, so it adds no significant parameter-level meaning beyond the baseline.

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 verb and resource: 'solve a 2D sketch constraint set.' It clearly identifies the operation and scope, and the qualifier '2D sketch' differentiates it from sibling tools like solve_mates or add_constraint. The purpose is unambiguous despite the slight redundancy in phrasing.

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?

The opening 'Use this when you need to solve a 2D sketch constraint set' provides an explicit trigger condition. It does not name alternatives or exclusions (e.g., solving mates), but the '2D sketch' scope and 'side-effect-free' note give enough context for an agent to select this tool over related siblings.

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.