Skip to main content
Glama
knishioka

Treasure Data MCP Server

by knishioka

td_get_session

Retrieve workflow session details by ID to verify execution status, schedule timing, and attempt information for scheduled Treasure Data workflow runs.

Instructions

Get workflow session details by ID to check execution status and timing.

A session is a scheduled workflow run. Use when you have a session ID and need to check if it ran successfully, when it was scheduled, or get attempt details. Common scenarios: - Verify if a scheduled workflow executed at the expected time - Get the attempt ID to investigate execution details - Check overall success/failure status Returns session info with workflow name, schedule time, and latest attempt status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Implementation Reference

  • The main handler function for the 'td_get_session' tool. It takes a session_id parameter, fetches the session details from the Treasure Data client, formats the response with session and last_attempt information, and handles errors.
    async def td_get_session(session_id: str) -> dict[str, Any]: """Get workflow session details by ID to check execution status and timing. A session is a scheduled workflow run. Use when you have a session ID and need to check if it ran successfully, when it was scheduled, or get attempt details. Common scenarios: - Verify if a scheduled workflow executed at the expected time - Get the attempt ID to investigate execution details - Check overall success/failure status Returns session info with workflow name, schedule time, and latest attempt status. """ if not session_id or not session_id.strip(): return _format_error_response("Session ID cannot be empty") client = _create_client(include_workflow=True) if isinstance(client, dict): return client try: session = client.get_session(session_id) if session: result = { "type": "session", "session": { "id": session.id, "project": session.project, "workflow": session.workflow, "session_uuid": session.session_uuid, "session_time": session.session_time, "last_attempt": { "id": session.last_attempt.id, "done": session.last_attempt.done, "success": session.last_attempt.success, "status": session.last_attempt.status, "created_at": session.last_attempt.created_at, "finished_at": session.last_attempt.finished_at, }, }, } return result else: return _format_error_response(f"Session with ID '{session_id}' not found") except Exception as e: return _format_error_response(f"Failed to get session: {str(e)}")
  • Registration of the 'td_get_session' tool (along with related execution tools) using the mcp.tool() decorator within the register_execution_tools function.
    # Register all tools 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)

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