Skip to main content
Glama

search_better_auth

Search Better Auth documentation to find authentication features, provider configurations, and setup guides for modern web frameworks.

Instructions

Search Better Auth documentation by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find relevant Better Auth features or documentation

Implementation Reference

  • The main handler function for the 'search_better_auth' tool. It validates the input query, ensures features are loaded, performs the search using searchFeaturesByQuery, limits results to top 10, and returns a formatted response.
    /** * Handle the search_better_auth tool request */ private async handleSearchBetterAuth(args: any) { const query = this.validateSearchQuery(args); try { await this.ensureFeaturesListLoaded(); const results = this.searchFeaturesByQuery(query); return this.createSuccessResponse({ query, results: results.slice(0, 10), // Limit to top 10 results total: results.length, }); } catch (error) { this.handleAxiosError(error, "Search failed"); } }
  • The tool schema definition including name, description, and input schema requiring a 'query' string.
    { name: "search_better_auth", description: "Search Better Auth documentation by keyword", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query to find relevant Better Auth features or documentation", }, }, required: ["query"], }, }, {
  • src/index.ts:231-232 (registration)
    The switch case registration that dispatches calls to the search_better_auth tool to its handler.
    case "search_better_auth": return await this.handleSearchBetterAuth(request.params.arguments);
  • Core search logic helper that filters and sorts cached BetterAuthFeatures based on query terms, prioritizing exact name matches.
    * Search features by query */ private searchFeaturesByQuery(query: string): BetterAuthFeature[] { if (!this.featuresListCache) { return []; } const searchTerms = query.toLowerCase().split(' '); return this.featuresListCache.filter(feature => { const searchText = `${feature.name} ${feature.description} ${feature.category}`.toLowerCase(); return searchTerms.some(term => searchText.includes(term)); }).sort((a, b) => { // Prioritize exact matches const aExact = a.name.toLowerCase().includes(query.toLowerCase()); const bExact = b.name.toLowerCase().includes(query.toLowerCase()); if (aExact && !bExact) return -1; if (!aExact && bExact) return 1; return 0; }); }
  • Helper function to validate and normalize the search query input.
    private validateSearchQuery(args: any): string { if (!args?.query || typeof args.query !== "string") { throw new McpError( ErrorCode.InvalidParams, "Search query is required and must be a string" ); } return args.query.toLowerCase(); }

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/dabhivijay2478/better-auth-mcp-server'

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