get_current_user
Retrieve your DevRev user profile details to identify the current authenticated user within the platform.
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)The execution handler for the 'get_current_user' tool. It invokes the DevRev API 'dev-users.self' endpoint to fetch and return the current user's details as text content.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 list_tools() handler, defining its name, description, and input schema (empty object).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-31 (schema)JSON Schema for the 'get_current_user' tool input, which requires no parameters (empty properties).inputSchema={"type": "object", "properties": {}},
- src/devrev_mcp/utils.py:12-39 (helper)Helper utility function 'make_devrev_request' used by the handler to perform authenticated POST requests to the DevRev API, including for 'dev-users.self' endpoint.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 )