Skip to main content
Glama
task_run_states.py1.22 kB
# ============================================================================ # task_run_states.py - Task Run States Module # ============================================================================ @mcp.tool async def get_task_run_state( state_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """Get a task run state by ID.""" try: async with get_client() as client: response = await client._client.get(f"/task_run_states/{state_id}") return [types.TextContent(type="text", text=str(response.json()))] except Exception as e: return [types.TextContent(type="text", text=f"Error: {str(e)}")] @mcp.tool async def get_task_run_states( task_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """Get all states for a task run.""" try: async with get_client() as client: response = await client._client.get(f"/task_run_states/?task_run_id={task_run_id}") return [types.TextContent(type="text", text=str({"states": response.json()}))] except Exception as e: return [types.TextContent(type="text", text=f"Error: {str(e)}")]

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/allen-munsch/mcp-prefect'

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