Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

search_services

Search for SMS verification service codes using natural language queries to identify the correct codes for platforms like Uber, Binance, or Steam.

Instructions

Find the right service code using natural language. Don't know the exact code? Just search "uber", "binance", "steam" etc. Returns matching services with similarity scores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query (e.g. "uber", "whatsapp", "binance")

Implementation Reference

  • Handler for 'search_services' tool. Performs fuzzy matching against available services.
    export async function handleSearchService(
      client: VirtualSMSClient,
      args: z.infer<typeof SearchServiceInput>
    ) {
      const services = await client.listServices();
      const query = args.query.toLowerCase().trim();
    
      const scored = services.map((s) => {
        const name = s.name.toLowerCase();
        const code = s.code.toLowerCase();
    
        let score = 0;
    
        if (code === query || name === query) {
          score = 1.0;
        } else if (code.startsWith(query) || name.startsWith(query)) {
          score = 0.9;
        } else if (code.includes(query) || name.includes(query)) {
          score = 0.7;
        } else {
          const queryTokens = query.split(/\s+/);
          const nameTokens = name.split(/[\s_-]+/);
          let matches = 0;
          for (const qt of queryTokens) {
            if (nameTokens.some((nt) => nt.includes(qt) || qt.includes(nt))) {
              matches++;
            }
          }
          if (matches > 0) {
            score = (matches / Math.max(queryTokens.length, nameTokens.length)) * 0.6;
          }
        }
    
        return { code: s.code, name: s.name, match_score: Math.round(score * 100) / 100 };
      });
    
      const matches = scored
        .filter((s) => s.match_score >= 0.5)
        .sort((a, b) => b.match_score - a.match_score)
        .slice(0, 5);
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(
              matches.length > 0
                ? {
                    query: args.query,
                    matches,
                    tip: `Use the "code" field as the service parameter in other tools.`,
                  }
                : {
                    query: args.query,
                    matches: [],
                    message: 'No matching services found',
                    tip: `Try list_services to browse all available services.`,
                  },
              null,
              2
            ),
          },
        ],
      };
    }
  • Input schema for 'search_services' tool.
    export const SearchServiceInput = z.object({
      query: z.string().describe('Natural language search query (e.g. "uber", "whatsapp", "binance", "steam")'),
    });
  • src/tools.ts:299-322 (registration)
    Registration definition for 'search_services' tool in TOOL_DEFINITIONS.
      name: 'search_services',
      title: 'Search Service by Name',
      description:
        'Find the right service code using natural language. ' +
        'Don\'t know the exact code? Just search "uber", "binance", "steam" etc. ' +
        'Returns matching services with similarity scores.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          query: {
            type: 'string',
            description: 'Natural language search query (e.g. "uber", "whatsapp", "binance")',
          },
        },
        required: ['query'],
      },
      annotations: {
        title: 'Search Service by Name',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    },

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/virtualsms-io/mcp-server'

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