get_object
Retrieve comprehensive details about any DevRev object by providing its unique identifier. Use this tool to access object information from the DevRev platform through the MCP server.
Instructions
Get all information about a DevRev object using its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/devrev_mcp/server.py:86-113 (handler)Handler logic for executing the 'get_object' tool. It extracts the object ID from arguments, calls the DevRev 'works.get' API endpoint, handles HTTP errors, and returns the object details as text content.elif name == "get_object": if not arguments: raise ValueError("Missing arguments") id = arguments.get("id") if not id: raise ValueError("Missing id parameter") response = make_devrev_request( "works.get", {"id": id} ) if response.status_code != 200: error_text = response.text return [ types.TextContent( type="text", text=f"Get object failed with status {response.status_code}: {error_text}" ) ] object_info = response.json() return [ types.TextContent( type="text", text=f"Object information for '{id}':\n{object_info}" ) ]
- src/devrev_mcp/server.py:33-43 (registration)Tool registration in the list_tools handler, defining the name, description, and input schema (requiring 'id' as string).types.Tool( name="get_object", description="Get all information about a DevRev object using its ID", inputSchema={ "type": "object", "properties": { "id": {"type": "string"}, }, "required": ["id"], }, )
- src/devrev_mcp/utils.py:5-32 (helper)Utility function to perform authenticated POST requests to DevRev API endpoints, used by the get_object handler to fetch object details.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/internal/{endpoint}", headers=headers, json=payload )