get_project_details
Retrieve comprehensive project details by specifying the project ID using the Harvest MCP Server. Streamline project management and access essential information efficiently.
Instructions
Get detailed information about a specific project.
Args:
project_id: The ID of the project to retrieve
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- harvest-mcp-server.py:193-201 (handler)The handler function that executes the 'get_project_details' tool logic. It retrieves project details from the Harvest API via a GET request to /projects/{project_id} and returns formatted JSON.@mcp.tool() async def get_project_details(project_id: int): """Get detailed information about a specific project. Args: project_id: The ID of the project to retrieve """ response = await harvest_request(f"projects/{project_id}") return json.dumps(response, indent=2)
- harvest-mcp-server.py:21-43 (helper)Supporting utility function used by get_project_details (and other tools) to make authenticated HTTP requests to the Harvest API.async def harvest_request(path, params=None, method="GET"): headers = { "Harvest-Account-Id": HARVEST_ACCOUNT_ID, "Authorization": f"Bearer {HARVEST_API_KEY}", "User-Agent": "Harvest MCP Server", "Content-Type": "application/json", } url = f"https://api.harvestapp.com/v2/{path}" async with httpx.AsyncClient() as client: if method == "GET": response = await client.get(url, headers=headers, params=params) else: response = await client.request(method, url, headers=headers, json=params) if response.status_code != 200: raise Exception( f"Harvest API Error: {response.status_code} {response.text}" ) return response.json()