This server has moderate structural quality but significant issues with description depth, parameter documentation, and output schema clarity. All 10 tools are explicitly registered with input schemas visible in src/index.ts. However, most descriptions are generic and lack LLM-actionable context (e.g., WHEN to use, prerequisites, expected output format). Parameter descriptions are present but often vague (e.g., 'Figma file URL or file key' without format examples). No output schemas are documented, which violates pattern:tool requirement. Several tools expose Figma API tokens as parameters despite critical guidance against credential exposure. Error handling is minimal, no recovery guidance or categorization. Tool composition has overlaps (parse_figma_design vs parse_figma_selection, both parse operations). The codebase shows defensive caching logic but no validation error messages visible in tool handlers.
Credentials exposed as tool parameters: accessToken required in parse_figma_design, add_figma_file, get_figma_node_thumbnail, read_figma_comments, post_figma_comment, parse_figma_selection. Agent traces and logs will capture these secrets. Violates pattern:secret-injection, use server-side injection via environment variables instead.
No output schemas documented for any tool. LLMs cannot predict return structure, forcing them to guess which fields are available for downstream tool calls. Violates pattern:tool requirement 'Document the output schema.'
CRITICAL: Move accessToken to server-side injection. Use environment variables (FIGMA_ACCESS_TOKEN) or a vault service. Remove accessToken from all tool parameters (parse_figma_design, add_figma_file, get_figma_node_thumbnail, read_figma_comments, post_figma_comment, parse_figma_selection). This prevents credential leakage into logs and agent traces.
CRITICAL: Document output schemas for all 10 tools in the tool definition. Example for parse_figma_design: 'Returns {components: [{id, name, type, props, children}], metadata: {fileId, fileKey}}'. This enables LLMs to chain tools correctly and extract required fields.
Expand tool descriptions to 150 - 250 characters, including WHEN to use and expected output. Example: 'Parse a Figma design file and extract component hierarchy and properties. Use this first to understand the design structure before generating code. Returns a list of components with their names, types, and Ant Design property mappings.'
Add format constraints to URL and ID parameters. Example for figmaUrl: 'Figma file URL (format: https://www.figma.com/file/<file_id>/<file_name>) or just the file_id (24-char alphanumeric)'. Prevents LLMs from passing invalid formats.
Clarify parse_figma_design vs parse_figma_selection in descriptions: parse_figma_design extracts the entire file structure; parse_figma_selection extracts a single user-selected node from a URL with node-id. LLMs need this distinction to pick the right tool.
Add error recovery guidance to tool descriptions. Example for parse_figma_design: 'If the token is invalid, verify your Figma API access token. If the file is inaccessible, check that the file_id is correct and your token has read:files scope.'
Descriptions are generic and under-optimized for LLM selection. Average length ~50 chars, well below 194-char baseline for A+ tools. Examples: 'Add a Figma file to the context for analysis' (56 chars) lacks WHEN/prerequisites/output format. 'Get mapping suggestions between Figma elements and Ant Design components' (72 chars) doesn't explain what 'mapping suggestions' returns or how to use them.
Parameter descriptions lack format constraints and examples. 'figmaUrl: Figma file URL or file key' is ambiguous, does it accept both 'https://www.figma.com/file/abc123/MyFile' AND 'abc123'? How does the tool normalize these? 'nodeId: Optional specific node ID to parse' doesn't explain nodeId format (alphanumeric? colons? lengths?). LLMs will hallucinate formats.
Overlapping tool responsibilities: parse_figma_design and parse_figma_selection both parse Figma content. Distinction is unclear from descriptions alone. LLMs will struggle to choose. Violates pattern:tool (each tool should do exactly one thing with clear boundaries).
No error handling guidance visible in tool definitions. If parse_figma_design fails due to invalid token, network error, or malformed nodeId, how should the LLM recover? No categorization (retryable, user-fixable, fatal). Violates pattern:recovery-guide.
generate_react_code and post_figma_comment are write/destructive operations but lack confirmation or dry-run support. An LLM could auto-generate and post broken code without user approval. Violates pattern:confirmation-request.
Parameter 'figmaData' in generate_react_code is documented as 'Parsed Figma design data' (object type with no schema constraint). What fields must it contain? What's the expected structure? LLMs cannot validate this before calling. Missing schema constraint violates constrained-input pattern.
Several tools return arrays (e.g., analyze_antd_components, read_figma_comments likely return lists) but no pagination parameters (limit, offset, page_size) are visible in schemas. Without pagination, large result sets risk context window exhaustion. Violates pattern:paginated-result.
No indication of which tools are idempotent. Agents may retry on ambiguous failures. generate_react_code, post_figma_comment, and add_figma_file are likely non-idempotent but lack explicit marking. Violates pattern:idempotent-operation.
Add readOnlyHint and destructiveHint annotations to tool schemas (new MCP feature). Mark generate_react_code and post_figma_comment as destructive so agents know to request confirmation.
Split add_figma_file and parse_figma_design: add_figma_file suggests it stores state (violates stateless protocol), but the server is STDIO-only with no storage. Clarify whether this tool persists across requests or just adds to current context. If current-context-only, rename to 'add_figma_file_to_context' and document scope clearly.
For generate_react_code, document the figmaData schema: 'Expected structure: {components: [{id, name, type, properties}], layout: {width, height, padding}}'. Link to a schema example or reference documentation.
Add pagination to read_figma_comments and analyze_antd_components (if they return lists). Accept 'limit' (default 20, max 100) and 'offset' or 'page' parameters. Return total_count so LLMs know if more results exist.
Mark non-idempotent tools explicitly in descriptions. For post_figma_comment and generate_react_code, add: 'NOTE: This tool creates new resources. Calling it multiple times with identical arguments will result in duplicate comments/generated code. Use confirmations or output caching to avoid duplicates.'
Remove 'e.g.' examples from parameter descriptions and move them to format constraints. Instead of 'figmaUrl (e.g., https://www.figma.com/file/abc123/MyFile)', use a regex pattern or format: 'figmaUrl: Valid Figma file URL or 24-char file_id. Format: https://www.figma.com/file/<FILE_ID>/<file_name>'.
Add context dependency hints. For generate_react_code: 'Call parse_figma_design() first to obtain figmaData. This tool cannot fetch Figma data on its own.'
For validate_generated_code, document what validation rules the 'strict' flag enables and what errors are returned. Example: 'strict=true enables TypeScript type checking, linting, and Ant Design API compliance checks. Returns {valid: bool, errors: [{line, message, fix}]}.'
Document get_component_mapping output and context parameter more clearly. What exactly is a 'mapping suggestion'? How is it used in the code generation workflow? Current description is vague.