Skip to main content
Glama
knishioka

Treasure Data MCP Server

by knishioka

td_list_sessions

Monitor recent workflow executions to check status and identify failures. Filter by workflow ID to view history or see all executions.

Instructions

List recent workflow executions to monitor status and find failures.

Shows recent scheduled runs (sessions) with their execution status. Filter by
workflow ID to see history of a specific workflow, or leave empty for all.

Common scenarios:
- Check which workflows ran recently and their status
- Find failed executions that need investigation
- Monitor execution patterns for a specific workflow
- Get session IDs for detailed analysis

Returns list with workflow names, execution times, and success/failure status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idNo
countNo

Implementation Reference

  • The main asynchronous handler function for the 'td_list_sessions' tool. It lists recent workflow sessions, optionally filtered by workflow_id, up to a specified count, using the Treasure Data client. Returns formatted session information including status and timing.
    async def td_list_sessions(
        workflow_id: str | None = None, count: int = 20
    ) -> dict[str, Any]:
        """List recent workflow executions to monitor status and find failures.
    
        Shows recent scheduled runs (sessions) with their execution status. Filter by
        workflow ID to see history of a specific workflow, or leave empty for all.
    
        Common scenarios:
        - Check which workflows ran recently and their status
        - Find failed executions that need investigation
        - Monitor execution patterns for a specific workflow
        - Get session IDs for detailed analysis
    
        Returns list with workflow names, execution times, and success/failure status.
        """
        client = _create_client(include_workflow=True)
        if isinstance(client, dict):
            return client
    
        try:
            sessions = client.get_sessions(workflow_id=workflow_id, last=count)
    
            session_list = []
            for session in sessions:
                session_info = {
                    "id": session.id,
                    "workflow": session.workflow["name"],
                    "project": session.project["name"],
                    "session_time": session.session_time,
                    "status": session.last_attempt.status,
                    "success": session.last_attempt.success,
                }
    
                # Add duration if available
                if session.last_attempt.created_at and session.last_attempt.finished_at:
                    session_info["created_at"] = session.last_attempt.created_at
                    session_info["finished_at"] = session.last_attempt.finished_at
    
                session_list.append(session_info)
    
            result = {
                "sessions": session_list,
                "count": len(session_list),
            }
    
            if workflow_id:
                result["filtered_by_workflow"] = workflow_id
    
            return result
    
        except Exception as e:
            return _format_error_response(f"Failed to list sessions: {str(e)}")
  • Registration of the 'td_list_sessions' tool (and related execution tools) using the mcp.tool() decorator within the register_execution_tools function.
    mcp.tool()(td_get_session)
    mcp.tool()(td_list_sessions)
    mcp.tool()(td_get_attempt)
    mcp.tool()(td_get_attempt_tasks)
    mcp.tool()(td_analyze_execution)
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 the tool's behavior: it's a read-only operation (implied by 'list', 'monitor', 'check'), returns recent executions with filtering capability, and specifies the return content (list with workflow names, execution times, success/failure status). However, it doesn't mention pagination, rate limits, or authentication requirements, which would be helpful for a production monitoring tool.

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 perfectly structured and concise: it starts with a clear purpose statement, provides usage guidance in the second paragraph, lists common scenarios in bullet points for quick scanning, and ends with return value information. Every sentence earns its place, with no redundant or vague language.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description provides excellent contextual completeness. It covers purpose, usage, parameters, return values, and common scenarios. The only minor gap is the lack of explicit mention of the 'count' parameter name and its effect on 'recent' definition, but overall it provides sufficient context for effective tool selection and use.

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

Parameters4/5

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

With 0% schema description coverage, the description must compensate for the undocumented parameters. It successfully explains both parameters: 'workflow_id' is described as a filter for specific workflow history (with option to leave empty), and 'count' is implied through 'recent' and the default value context. While it doesn't explicitly name 'count' or specify numeric ranges, it provides meaningful semantic context that significantly enhances understanding 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 tool's purpose with specific verbs ('list recent workflow executions', 'monitor status', 'find failures') and distinguishes it from siblings by focusing on execution sessions rather than workflows, projects, or other resources. It explicitly identifies the resource as 'recent scheduled runs (sessions)' with their execution status.

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 provides explicit guidance on when to use this tool versus alternatives: 'Filter by workflow ID to see history of a specific workflow, or leave empty for all.' It also lists common scenarios (check recent runs, find failures, monitor patterns, get session IDs) and implicitly distinguishes it from sibling tools like td_get_session (detailed analysis) and td_list_workflows (workflow listings rather than executions).

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