Skip to main content
Glama

get_integration_guide

Retrieve framework-specific authentication integration guides to configure Better Auth for production-ready setups.

Instructions

Get integration guide for a specific framework or platform

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkYesFramework name (e.g., "next", "remix", "astro", "expo")

Implementation Reference

  • The primary handler function for the 'get_integration_guide' tool. Validates the framework argument, checks cache, fetches/parses the guide if necessary, caches the result, and returns a JSON-formatted response.
    private async handleGetIntegrationGuide(args: any) { const framework = this.validateFramework(args); try { // Check cache first if (this.integrationCache.has(framework)) { return this.createSuccessResponse(this.integrationCache.get(framework)); } // Fetch integration guide const guide = await this.fetchIntegrationGuide(framework); // Save to cache this.integrationCache.set(framework, guide); return this.createSuccessResponse(guide); } catch (error) { this.handleAxiosError(error, `Integration guide for "${framework}"`); } }
  • Tool schema definition including name, description, and input schema that requires a 'framework' string parameter.
    { name: "get_integration_guide", description: "Get integration guide for a specific framework or platform", inputSchema: { type: "object", properties: { framework: { type: "string", description: "Framework name (e.g., \"next\", \"remix\", \"astro\", \"expo\")", }, }, required: ["framework"], }, },
  • src/index.ts:227-228 (registration)
    Registration of the tool handler in the CallToolRequest switch statement.
    case "get_integration_guide": return await this.handleGetIntegrationGuide(request.params.arguments);
  • Key helper function that performs the HTTP request to Better Auth docs, parses HTML with Cheerio, extracts guide content (title, description, setup, config, examples), and constructs the IntegrationGuide object.
    private async fetchIntegrationGuide(framework: string): Promise<IntegrationGuide> { const url = `${this.BETTER_AUTH_DOCS_URL}/docs/integrations/${framework}`; try { const response = await this.axiosInstance.get(url); const $ = cheerio.load(response.data); const title = $("h1").first().text().trim(); const description = this.extractDescription($); const setup = this.extractSetup($); const config = this.extractConfiguration($); const examples = this.extractExamples($); return { name: title || framework, framework, description: description || `Better Auth integration guide for ${framework}`, url, setup, config, examples, }; } catch (error) { throw new McpError( ErrorCode.InvalidParams, `Integration guide for "${framework}" not found` ); } }
  • Input validation helper specifically for the framework parameter used by the handler.
    private validateFramework(args: any): string { if (!args?.framework || typeof args.framework !== "string") { throw new McpError( ErrorCode.InvalidParams, "Framework name is required and must be a string" ); } return args.framework.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