get_work
Retrieve detailed information about a DevRev work item (issue or ticket) by providing its unique ID to access all relevant data.
Instructions
Get all information about a DevRev work item (issue, ticket) using its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The DevRev ID of the work item |
Implementation Reference
- src/devrev_mcp/server.py:571-599 (handler)The handler function that executes the 'get_work' tool. It validates the input arguments, calls the DevRev API endpoint 'works.get' with the work item ID, handles errors, and returns the response as text content.elif name == "get_work": 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}" ) ] return [ types.TextContent( type="text", text=f"Object information for '{id}':\n{response.json()}" ) ]
- src/devrev_mcp/server.py:63-73 (registration)Registration of the 'get_work' tool in the list_tools handler, including its name, description, and input schema for JSON Schema validation.types.Tool( name="get_work", description="Get all information about a DevRev work item (issue, ticket) using its ID", inputSchema={ "type": "object", "properties": { "id": {"type": "string", "description": "The DevRev ID of the work item"}, }, "required": ["id"], }, ),
- src/devrev_mcp/utils.py:12-39 (helper)Helper utility function called by the 'get_work' handler to perform the authenticated HTTP POST request to the DevRev API.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 )