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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/bloomy_mcp/operations.py:183-208 (handler)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)}"
- src/bloomy_mcp/server.py:40-40 (registration)Registers the get_authenticated_user_id handler as an MCP tool using the FastMCP library's tool decorator.mcp.tool()(get_authenticated_user_id)
- src/bloomy_mcp/server.py:14-40 (registration)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)
- src/bloomy_mcp/__init__.py:35-35 (helper)Exports the tool in the package __all__ list for easy import."get_authenticated_user_id",