Skip to main content
Glama
MarySuneela

Visa Design System MCP Server

by MarySuneela

get-component-examples

Retrieve code examples for Visa Design System components to implement UI elements correctly and consistently.

Instructions

Get code examples for a specific component

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesComponent name

Implementation Reference

  • Tool registration definition including name, description, and input schema for get-component-examples
    {
      name: 'get-component-examples',
      description: 'Get code examples for a specific component',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Component name'
          }
        },
        required: ['name']
      }
    },
  • MCP protocol handler for get-component-examples tool: validates input, delegates to ComponentService, formats JSON response as CallToolResult
    /**
     * Handle get-component-examples tool call
     */
    private async handleGetComponentExamples(args: Record<string, any>): Promise<CallToolResult> {
      const { name } = args;
      
      if (!name || typeof name !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Component name is required and must be a string'
        );
      }
    
      const examples = await this.componentService.getComponentExamples(name);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              component: name,
              examples,
              count: examples.length
            }, null, 2)
          }
        ]
      };
    }
  • Helper method in ComponentService that retrieves examples for a given component from cached data
     * Get component examples and code snippets
     */
    async getComponentExamples(name: string): Promise<ComponentExample[]> {
      const component = await this.getComponent(name);
      return component.examples;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' examples, implying a read operation, but does not describe any behavioral traits such as error handling, response format, or whether it returns all examples or a subset. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is a single, clear sentence with no wasted words. It is front-loaded with the core purpose, making it easy to parse and understand quickly. This is an example of efficient communication.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not explain what the tool returns (e.g., code snippets, links, or structured data) or any limitations. For a tool with no structured behavioral hints, the description should provide more context to be fully helpful.

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?

The input schema has 100% description coverage, with the 'name' parameter documented as 'Component name'. The description adds no additional meaning beyond this, such as format examples or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('code examples for a specific component'), making it easy to understand what the tool does. However, it does not explicitly differentiate from sibling tools like 'get-component-details' or 'search-components', which might also retrieve component-related information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get-component-details', 'get-components', and 'search-components' available, there is no indication of when this tool is appropriate (e.g., for examples only) or when other tools should be used instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarySuneela/mcp-vpds'

If you have feedback or need assistance with the MCP directory API, please join our Discord server