Skip to main content
Glama
knishioka

Treasure Data MCP Server

by knishioka

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
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • 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)}"
            )
  • 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")
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool returns ('project information including creation time, last update, and revision hash') and provides practical usage scenarios. However, it doesn't mention error conditions, rate limits, or authentication requirements, which would be helpful for a complete behavioral picture.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose. Every sentence adds value: the opening statement defines the tool, the second describes returns, the third provides prerequisites, the bulleted scenarios offer practical context, and the final notes clarify parameter format and alternatives. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read operation with no annotations or output schema, the description provides excellent context about what information is returned and how to use the tool. It covers purpose, prerequisites, alternatives, and parameter semantics well. The main gap is lack of information about return format structure or error conditions, which would be helpful given no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must fully compensate. It provides crucial semantic information about the project_id parameter: 'Use numeric project ID (e.g., "123456") not project name.' This clarifies the expected format and distinguishes it from project_name alternatives, adding significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get workflow project details by ID') and resource ('project'), distinguishing it from siblings like td_get_project_by_name (which uses name instead of ID) and td_download_project_archive (which retrieves contents rather than metadata). The opening sentence provides a precise verb+resource combination with clear scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('Use after finding project ID from td_list_projects') and when not to use it ('For project contents, use td_download_project_archive'). It provides clear alternatives and prerequisites, with specific sibling tool names mentioned for context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knishioka/td-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server