Skip to main content
Glama

get_authenticated_user_id

Retrieve the authenticated user ID using the current API token for Bloom Growth platform operations. Returns the user ID string or an error message if unsuccessful.

Instructions

Get the ID of the currently authenticated user.

Uses a special mutation to retrieve the ID of the user associated with the current API token. Returns: User ID string if successful, None if user not found, or error message string Raises: Exception: Handled internally, returns error message as string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes a GraphQL mutation to fetch the ID of the currently authenticated user via the default GraphQL client.
    def get_authenticated_user_id() -> Union[str, None]: """Get the ID of the currently authenticated user. Uses a special mutation to retrieve the ID of the user associated with the current API token. Returns: User ID string if successful, None if user not found, or error message string Raises: Exception: Handled internally, returns error message as string """ try: query = gql( """ mutation GetAuthenticatedUserId { getAuthenticatedUserId } """ ) result = default_client.execute(query) return result.get("getAuthenticatedUserId") except Exception as e: return f"Error getting authenticated user ID: {str(e)}"
  • Registers the get_authenticated_user_id handler as an MCP tool using the FastMCP library's tool decorator.
    mcp.tool()(get_authenticated_user_id)
  • Imports the get_authenticated_user_id function from operations.py for use in the MCP server.
    from bloomy_mcp.operations import ( get_query_details, get_mutation_details, execute_query, get_authenticated_user_id, ) # Initialize FastMCP server dependencies = [ "gql", "httpx", "pyyaml", ] mcp = FastMCP("bloom-graphql", dependencies=dependencies) # Register resources mcp.resource("bloom://queries")(get_available_queries) mcp.resource("bloom://mutations")(get_available_mutations) # Register tools mcp.tool()(get_query_details) mcp.tool()(get_mutation_details) mcp.tool()(execute_query) mcp.tool()(get_authenticated_user_id)
  • Exports the tool in the package __all__ list for easy import.
    "get_authenticated_user_id",

Other Tools

Related 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/franccesco/bloomy-mcp'

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