MCP bridge server that enables communication between Claude and Grasshopper via a TCP-based protocol for managing Grasshopper components, connections, and geometry operations
This server exhibits severe definition quality issues across all dimensions. Tools are defined in C# (GrasshopperCommandRegistry.cs, IntentCommandHandler.cs, ComponentCommandHandler.cs) but the provided source snippets are incomplete and show only partial implementation. Critical gaps: (1) Most tool descriptions are in Chinese ('創建點', '添加組件', etc.) rather than English, violating LLM optimization standards. (2) Input schemas are partially visible but many tools lack complete parameter documentation. For example, set_component_value (tool 6) has no visible input schema in the provided code. (3) Descriptions are extremely brief (3-8 characters for many tools), well below the 10-1024 character baseline and incapable of guiding LLM tool selection. (4) No output schemas are documented anywhere. (5) Parameter descriptions, where present, are minimal (e.g., 'Component type name or GUID' for add_component's 'type' param lacks constraints, format guidance, or examples). (6) No evidence of error handling patterns, recovery guidance, or actionable error messages. (7) Composition is poor: create_point, create_curve, create_circle are separate tools that could be unified; no pagination, batching, or chaining guidance. (8) No security annotations, permission gates, or audit trail patterns visible.
Descriptions are in Chinese and extremely brief (3-8 chars). LLMs cannot determine when/why to select tools based on '創建點' (create point in Chinese). All 13 tools fail the 10-1024 character baseline and the 'non-empty description' critical check.
Input schemas are incomplete or missing entirely. set_component_value, get_component_info have no visible input schema in provided source. Many params lack descriptions (e.g., 'sourceParamIndex' in connect_components says '(optional if sourceParam provided)' but does not describe what the index represents, valid range, or consequences of omission).
Translate ALL tool descriptions to English and expand to 50-200 characters. Example: 'create_point' should be: 'Create a 3D point in the Grasshopper document at the specified X, Y, Z coordinates. Returns the created point ID for use in downstream operations. Required before creating curves or circles.'
Document complete input schemas with type, description, and constraints for ALL parameters. For set_component_value and get_component_info, make schemas explicit. For numeric params (x, y, z, radius), add min/max bounds and units. For string params (component type, path), add enums or regex patterns.
Add output schemas to all tools. Example: 'create_point returns {point_id: string, x: number, y: number, z: number, timestamp: ISO8601}'. This enables chaining, if add_component returns component_id, connect_components knows to expect that ID.
Implement error handling with recovery guidance. Every tool should document: (1) expected error cases (e.g., 'No active Grasshopper document' for add_component), (2) error classification (retryable vs user-fixable vs fatal), (3) recovery action (e.g., 'Launch Grasshopper and open a document, then retry').
Add tool annotations to schema. Example: clear_document should have {destructiveHint: true, idempotentHint: false} to signal agents this is irreversible and cannot be safely retried.
Consolidate geometric creation. Merge create_point, create_curve, create_circle into a unified 'create_geometry' tool with a 'geometry_type' enum parameter (point, curve, circle). This reduces cognitive load on LLMs and supports composable intent.
No output schemas documented. LLMs cannot plan downstream tool calls or extract required chaining IDs. For example, add_component likely returns a component GUID, but there is no documented schema confirming this. This violates the 'document the output schema' critical check.
No error handling, error classification, or recovery guidance. Code shows throw statements (e.g., 'throw new InvalidOperationException') but tool definitions do not document expected error cases, how to distinguish retryable vs fatal, or what the LLM should do next.
Destructive tools (clear_document) lack confirmation or dry-run support. A tool that empties a Grasshopper document should require explicit confirmation or support a preview mode. No evidence of permission gates or audit trail patterns.
Parameter constraints are missing or underspecified. For example, create_point's x, y, z are 'double' but lack min/max bounds, precision requirements, or units (are they Rhino units?). connect_components' sourceParamIndex/targetParamIndex lack range constraints. No enum types for parameters that should be constrained (e.g., component type in add_component).
Composition and idempotency not addressed. create_point, create_curve, create_circle are separate tools that could benefit from a unified geometry creation interface. No evidence that tools are idempotent (repeated calls with same input produce same result), critical for agent retries. No batch variants for loops.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) visible in provided source. Agents cannot distinguish safe read operations from destructive writes without these hints.
Document parameter dependencies. For connect_components, clarify: 'Either sourceParam OR sourceParamIndex must be provided, not both. If both omitted, error = "Missing source parameter identifier". sourceParamIndex is 0-indexed and must be < number of inputs on source component.'
Add batch variants. For loops where agents might call add_component repeatedly, support 'add_components' (array input) to reduce round-trips and tokens.
Implement idempotency support. Tools like save_document and load_document should document idempotency: 'Calling save_document(path) twice returns identical result. Calling load_document(path) twice loads the file each time (use get_document_info to check current state before loading).'
Add permission/scope declarations. Document what Grasshopper operations each tool requires (e.g., add_component requires 'grasshopper:write', clear_document requires 'grasshopper:admin'). This enables least-privilege agent configuration.