get_current_user
Retrieve detailed information about the current DevRev user by calling this tool, typically used when 'me' is specified in queries.
Instructions
Fetch the current DevRev user details. When the user specifies 'me' in the query, this tool should be called to get the user details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/devrev_mcp/server.py:482-502 (handler)Handler implementation for the 'get_current_user' tool within the handle_call_tool function. It calls the DevRev API endpoint 'dev-users.self' to fetch and return the current user's details.if name == "get_current_user": response = make_devrev_request( "dev-users.self", {} ) if response.status_code != 200: error_text = response.text return [ types.TextContent( type="text", text=f"Get current user failed with status {response.status_code}: {error_text}" ) ] return [ types.TextContent( type="text", text=f"Current DevRev user details: {response.json()}" ) ]
- src/devrev_mcp/server.py:28-32 (registration)Registration of the 'get_current_user' tool in the handle_list_tools function, defining its name, description, and input schema (no required parameters).types.Tool( name="get_current_user", description="Fetch the current DevRev user details. When the user specifies 'me' in the query, this tool should be called to get the user details.", inputSchema={"type": "object", "properties": {}}, ),
- src/devrev_mcp/server.py:31-32 (schema)Input schema for the 'get_current_user' tool: an empty object (no parameters required).inputSchema={"type": "object", "properties": {}}, ),
- src/devrev_mcp/utils.py:12-39 (helper)Utility function 'make_devrev_request' imported and used by the tool handler to perform authenticated POST requests to DevRev API endpoints.def make_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Response: """ Make an authenticated request to the DevRev API. Args: endpoint: The API endpoint path (e.g., "works.get" or "search.hybrid") payload: The JSON payload to send Returns: requests.Response object Raises: ValueError: If DEVREV_API_KEY environment variable is not set """ api_key = os.environ.get("DEVREV_API_KEY") if not api_key: raise ValueError("DEVREV_API_KEY environment variable is not set") headers = { "Authorization": f"{api_key}", "Content-Type": "application/json", } return requests.post( f"https://api.devrev.ai/{endpoint}", headers=headers, json=payload )