Skip to main content
Glama
gemini-dk

Firebase MCP Server

by gemini-dk

auth_get_user

Retrieve user details by ID or email from Firebase Authentication to verify identity and access account information.

Instructions

Get a user by ID or email from Firebase Authentication

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesUser ID or email address

Implementation Reference

  • The core handler function for the 'auth_get_user' tool. It retrieves a user record from Firebase Authentication by either UID or email address and returns it as a formatted MCP content response.
    export async function getUserByIdOrEmail(identifier: string) {
      try {
        let userRecord;
        if (identifier.includes('@')) {
          // メールアドレスで検索
          userRecord = await admin.auth().getUserByEmail(identifier);
        } else {
          // ユーザIDで検索
          userRecord = await admin.auth().getUser(identifier);
        }
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(userRecord, null, 2)
            }
          ]
        };
      } catch (error) {
        console.error('Error fetching user:', error);
        throw error;
      }
    }
  • Input schema definition for the 'auth_get_user' tool, specifying the required 'identifier' parameter as a string.
    inputSchema: {
      type: "object",
      properties: {
        identifier: {
          type: "string",
          description: "User ID or email address"
        }
      },
      required: ["identifier"]
    }
  • src/index.ts:181-194 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for 'auth_get_user'.
    {
      name: "auth_get_user",
      description: "Get a user by ID or email from Firebase Authentication",
      inputSchema: {
        type: "object",
        properties: {
          identifier: {
            type: "string",
            description: "User ID or email address"
          }
        },
        required: ["identifier"]
      }
    },
  • src/index.ts:250-251 (registration)
    Switch case in CallToolRequestHandler that dispatches 'auth_get_user' calls to the handler function.
    case 'auth_get_user':
      return getUserByIdOrEmail(args.identifier as string);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a read operation ('Get'), but doesn't mention authentication requirements, rate limits, error handling, or what happens with invalid identifiers. For a tool accessing user data, this is a significant gap in behavioral context.

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 with zero waste. It's appropriately sized for a simple retrieval tool and front-loads the essential information. Every word earns its place.

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?

For a single-parameter read tool with no output schema, the description is minimally adequate. It covers what the tool does but lacks important context about authentication requirements, error behavior, and return format. The absence of annotations means the description should do more to compensate.

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?

Schema description coverage is 100%, so the schema already fully documents the single parameter. The description adds minimal value by specifying 'User ID or email address' which the schema already states. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Get a user') and resource ('from Firebase Authentication'), with specificity about the identifier type ('by ID or email'). However, it doesn't distinguish this tool from potential siblings in the authentication domain, as the sibling list only includes Firestore and Storage tools.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, error conditions, or comparisons with other user retrieval methods. It's a basic functional statement without usage context.

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/gemini-dk/mcp-server-firebase'

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