Skip to main content
Glama
MarySuneela

Visa Design System MCP Server

by MarySuneela

search-guidelines

Find Visa Design System guidelines by searching content, titles, or tags. Simplify access to design tokens, components, and usage standards with a single query.

Instructions

Search guidelines by content, title, or tags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for guidelines

Implementation Reference

  • Core implementation of the search logic: filters cached guidelines where query matches title, content, category, or any tag (case-insensitive).
    async searchGuidelines(query: string): Promise<Guideline[]> { return this.circuitBreaker.execute(async () => { if (!query || typeof query !== 'string') { throw new ValidationError('Search query must be a non-empty string', [], { service: 'GuidelinesService', method: 'searchGuidelines', query }); } const cachedData = this.dataManager.getCachedData(); if (!cachedData) { throw new DataError('No guidelines data available', [ 'Ensure data files are loaded', 'Check data directory configuration' ], { service: 'GuidelinesService', method: 'searchGuidelines' }); } const searchTerm = query.toLowerCase(); return cachedData.guidelines.filter(guideline => { // Search in title if (guideline.title.toLowerCase().includes(searchTerm)) { return true; } // Search in content if (guideline.content.toLowerCase().includes(searchTerm)) { return true; } // Search in category if (guideline.category.toLowerCase().includes(searchTerm)) { return true; } // Search in tags if (guideline.tags.some(tag => tag.toLowerCase().includes(searchTerm) )) { return true; } return false; }); }, { service: 'GuidelinesService', method: 'searchGuidelines', query }); }
  • MCP server handler for 'search-guidelines' tool: validates input query, calls GuidelinesService.searchGuidelines, returns JSON-formatted results with count.
    private async handleSearchGuidelines(args: Record<string, any>): Promise<CallToolResult> { const { query } = args; if (!query || typeof query !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'Query parameter is required and must be a string' ); } const guidelines = await this.guidelinesService.searchGuidelines(query); return { content: [ { type: 'text', text: JSON.stringify({ guidelines, count: guidelines.length, query }, null, 2) } ] }; }
  • Tool registration in getToolDefinitions(): defines name, description, and input schema requiring 'query' string.
    { name: 'search-guidelines', description: 'Search guidelines by content, title, or tags', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for guidelines' } }, required: ['query'] } }
  • Switch case in handleToolCall that routes 'search-guidelines' calls to the handler function.
    case 'search-guidelines': return await this.handleSearchGuidelines(args);

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