Skip to main content
Glama

execute_program

Execute Python programs that call multiple MCP tools in sequence, handling loops, conditional logic, and data aggregation while keeping intermediate results local to reduce latency.

Instructions

Execute a Python program with access to MCP tools as async functions. Tool calls within the script are dispatched to their respective MCP servers. Only stdout (from print statements) is returned — intermediate tool results do not enter the conversation context. Use this when a task involves 3+ tool calls, loops, filtering, aggregation, or conditional logic based on intermediate results. For single tool calls, call the tool directly. All tool functions require await.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython code to execute. MCP tools are available as async functions using their namespaced names (e.g., mcp__financial_data__query_financials). Use `await` for all tool calls. Use `print()` to produce output.
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/gallanoe/ptc-mcp'

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