Skip to main content
Glama
dabhivijay2478

Better Auth MCP Server

get_feature_details

Retrieve detailed documentation and setup information for Better Auth authentication features like two-factor, GitHub integration, or database adapters.

Instructions

Get detailed information about a specific Better Auth plugin or feature

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureNameYesName of the Better Auth feature (e.g., "two-factor", "github", "drizzle")

Implementation Reference

  • The main handler function for the get_feature_details tool. It validates the feature name, checks cache, fetches detailed information if needed, caches the result, and returns a standardized response.
    private async handleGetFeatureDetails(args: any) {
      const featureName = this.validateFeatureName(args);
    
      try {
        // Check cache first
        if (this.featureCache.has(featureName)) {
          return this.createSuccessResponse(this.featureCache.get(featureName));
        }
    
        // Fetch detailed feature information
        const featureInfo = await this.fetchFeatureDetails(featureName);
        
        // Save to cache
        this.featureCache.set(featureName, featureInfo);
        
        return this.createSuccessResponse(featureInfo);
      } catch (error) {
        this.handleAxiosError(error, `Feature "${featureName}"`);
      }
    }
  • src/index.ts:149-162 (registration)
    Registration of the get_feature_details tool in the MCP server's tool list, including name, description, and input schema definition.
    {
      name: "get_feature_details",
      description: "Get detailed information about a specific Better Auth plugin or feature",
      inputSchema: {
        type: "object",
        properties: {
          featureName: {
            type: "string",
            description: "Name of the Better Auth feature (e.g., \"two-factor\", \"github\", \"drizzle\")",
          },
        },
        required: ["featureName"],
      },
    },
  • src/index.ts:225-226 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes get_feature_details calls to the handleGetFeatureDetails method.
    case "get_feature_details":
      return await this.handleGetFeatureDetails(request.params.arguments);
  • Key helper function that performs the actual data fetching and web scraping to get detailed feature information from Better Auth documentation.
    private async fetchFeatureDetails(featureName: string): Promise<BetterAuthFeature> {
      // Find the feature in our categories
      const category = this.findFeatureCategory(featureName);
      if (!category) {
        throw new McpError(ErrorCode.InvalidParams, `Unknown feature: ${featureName}`);
      }
    
      const basicInfo = await this.fetchFeatureBasicInfo(featureName, category);
      
      try {
        const response = await this.axiosInstance.get(basicInfo.url);
        const $ = cheerio.load(response.data);
        
        // Extract detailed information
        const description = this.extractDescription($);
        const installation = this.extractInstallation($);
        const usage = this.extractUsage($);
        const config = this.extractConfiguration($);
        const examples = this.extractExamples($);
        
        return {
          ...basicInfo,
          description: description || basicInfo.description,
          installation,
          usage,
          config,
          examples,
        };
      } catch (error) {
        // Return basic info if detailed fetch fails
        return basicInfo;
      }
    }
  • Validation helper used by the handler to validate and normalize the featureName input parameter.
    private validateFeatureName(args: any): string {
      if (!args?.featureName || typeof args.featureName !== "string") {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Feature name is required and must be a string"
        );
      }
      return args.featureName.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 tool 'gets' information, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured or unstructured data, or handles errors. For a tool with no annotations, this leaves key behavioral traits unaddressed.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. There's no wasted verbiage or redundant information.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no nested objects) and high schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it fails to explain what the detailed information includes (e.g., documentation, configuration options, status). For a tool named 'get_feature_details', more context on the output would be beneficial.

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 parameter 'featureName' clearly documented as the name of the Better Auth feature. The description doesn't add any extra meaning beyond what the schema provides, such as examples beyond those in the schema or constraints on valid feature names. Given the high schema coverage, a baseline score of 3 is appropriate.

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 the resource 'detailed information about a specific Better Auth plugin or feature', making the purpose understandable. However, it doesn't explicitly distinguish this tool from its sibling 'list_better_auth_features' (which likely lists features without details) or 'search_better_auth' (which might search across features), leaving some ambiguity in sibling differentiation.

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, such as whether it's for retrieving metadata, documentation, or operational details. With multiple sibling tools available, this lack of comparative guidance is a significant gap.

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