td_get_project
Retrieve workflow project details by ID to access metadata, check update timestamps, and verify revision information for version tracking in Treasure Data.
Instructions
Get workflow project details by ID to check metadata and revision.
Retrieves project information including creation time, last update, and
revision hash. Use after finding project ID from td_list_projects.
Common scenarios:
- Get project metadata before downloading archive
- Check when project was last updated
- Verify project exists by ID
- Get revision for version tracking
Note: Use numeric project ID (e.g., "123456") not project name.
For project contents, use td_download_project_archive.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- td_mcp_server/mcp_impl.py:350-388 (handler)The core handler function for the 'td_get_project' tool. Decorated with @mcp.tool() which also handles registration. Validates project_id, creates TreasureDataClient with workflow support, calls client.get_project(project_id), and returns project details or error.@mcp.tool() async def td_get_project(project_id: str) -> dict[str, Any]: """Get workflow project details by ID to check metadata and revision. Retrieves project information including creation time, last update, and revision hash. Use after finding project ID from td_list_projects. Common scenarios: - Get project metadata before downloading archive - Check when project was last updated - Verify project exists by ID - Get revision for version tracking Note: Use numeric project ID (e.g., "123456") not project name. For project contents, use td_download_project_archive. """ # Input validation - prevent path traversal if not _validate_project_id(project_id): return _format_error_response("Invalid project ID format") client = _create_client(include_workflow=True) if isinstance(client, dict): return client try: project = client.get_project(project_id) if project: return {"project": project.model_dump()} else: return _format_error_response(f"Project with ID '{project_id}' not found") except (ValueError, requests.RequestException) as e: return _format_error_response( f"Failed to retrieve project '{project_id}': {str(e)}" ) except Exception as e: return _format_error_response( f"Unexpected error while retrieving project '{project_id}': {str(e)}" )
- td_mcp_server/mcp_impl.py:350-350 (registration)The @mcp.tool() decorator registers the td_get_project function as an MCP tool.@mcp.tool()
- The td_get_project_by_name tool which references and provides similar functionality to td_get_project, using name lookup instead of ID.async def td_get_project_by_name( project_name: str, ) -> dict[str, Any]: """Get full project details using exact name instead of ID. Convenient shortcut when you know the exact project name. Combines find + get operations for immediate detailed results. Common scenarios: - User provides exact project name, need full details - Quick project metadata lookup by name - Avoiding two-step process (find ID then get details) - Getting revision/timestamps for known project Requires exact name match. For fuzzy search use td_find_project. Returns same details as td_get_project but using name lookup. """ if not project_name or not project_name.strip(): return _format_error_response("Project name cannot be empty") # Use find_project with exact match search_result = await td_find_project(project_name, exact_match=True) if search_result.get("found") and search_result.get("projects"): project = search_result["projects"][0] # Get full details using td_get_project client = _create_client(include_workflow=True) if isinstance(client, dict): return client try: full_project = client.get_project(project["id"]) if full_project: return {"project": full_project.model_dump()} else: return _format_error_response( f"Could not retrieve details for project '{project_name}'" ) except Exception as e: return _format_error_response(f"Failed to get project details: {str(e)}") return _format_error_response(f"Project '{project_name}' not found")