Skip to main content
Glama
dabhivijay2478

Better Auth MCP Server

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();
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't describe any behavioral traits such as whether this is a read-only operation, if it requires authentication, potential rate limits, error handling, or the format of the returned guide. This leaves significant gaps for an AI agent to understand how to invoke it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It directly states what the tool does, making it easy to parse and understand quickly. Every part of the sentence earns its place by specifying the action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like safety or performance, nor does it hint at the return format (e.g., whether it's a document, link, or structured data). For a tool with no structured support, the description should provide more context to compensate, but it falls short.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'framework' parameter well-documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples of frameworks not listed or context about how the framework name is used. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('integration guide') with specificity about the target ('for a specific framework or platform'). It distinguishes the tool's purpose from siblings like 'get_auth_examples' or 'get_feature_details' by focusing on integration guides. However, it doesn't explicitly differentiate from 'get_llms_context' or 'search_better_auth', which slightly reduces clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or exclusions. For example, it doesn't clarify if this is for initial setup versus troubleshooting, or when to choose 'get_integration_guide' over 'list_better_auth_features' or 'search_better_auth' for related information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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