Skip to main content
Glama
normalize-id.ts466 B
/** * Normalize a source ID to create a valid tool name suffix * Converts all non-alphanumeric characters to underscores * * Examples: * "prod_db" -> "prod_db" * "staging-db" -> "staging_db" * "dev.db" -> "dev_db" * "my@db#123" -> "my_db_123" * * @param id - The source ID to normalize * @returns The normalized ID safe for use in tool names */ export function normalizeSourceId(id: string): string { return id.replace(/[^a-zA-Z0-9]/g, '_'); }

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/bytebase/dbhub'

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