Skip to main content
Glama

pfc_execute_task

Submit a Python script for asynchronous execution in PFC. The tool returns a task ID and runs the script in the background, allowing monitoring and control via companion tools.

Instructions

Submit a Python script file for asynchronous execution in PFC.

Returns a task_id immediately; the script runs in the background. Use the companion tools to manage the task lifecycle:

  • pfc_check_task_status: poll output, progress, and final status

  • pfc_interrupt_task: cancel a running task

  • pfc_list_tasks: browse task history

While the task is cycling, you can call pfc_execute_code at any time to inspect or modify simulation state — including variables the task depends on. This is the standard way to probe progress, tune parameters mid-run, swap callbacks, or trigger early termination via a sentinel variable. Both tools share the same main namespace in PFC's main thread.

Console output from itasca.command() inside the script — table dumps, list output, command summaries — is captured and interleaved with Python prints in the task log, visible through pfc_check_task_status.

Do NOT have the script invoke program call '<file>.p3dat' (or .p2dat / .dat). PFC's command-script interpreter blocks the bridge for the script's entire duration with no cycle-gap interleaving, leaving the bridge unreachable until PFC is stopped manually. If the user asks to run a .dat / .p3dat / .p2dat file, read the file and translate its commands into a sequence of itasca.command(...) calls in the Python script instead.

This is the async / background execution path: pollable via pfc_check_task_status, cancellable via pfc_interrupt_task. Submission does not lock parameters — start with reasonable values and refine live via pfc_execute_code as the task cycles. For synchronous, inline execution, use pfc_execute_code directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_scriptYesAbsolute path to entry Python script in PFC workspace
descriptionYesBrief task purpose

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, but the description fully discloses behavior: returns task_id immediately, runs in background, polling/cancellation via companion tools, namespace sharing with pfc_execute_code, and the blocking issue with .dat files.

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

Conciseness4/5

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

The description is well-structured with paragraphs, front-loading key purpose. Although verbose, every sentence adds value. Minor redundancy but overall efficient.

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

Completeness5/5

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

Given the complexity and presence of output schema, the description covers all necessary aspects: purpose, usage, behavioral traits, and interactions with siblings. No gaps identified.

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?

Schema coverage is 100% and describes parameters well. The description adds value by clarifying that entry_script is an absolute path and description is a brief purpose, beyond what schema provides.

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 action: 'Submit a Python script file for asynchronous execution in PFC.' It uses specific verb+resource and distinguishes itself from siblings like pfc_execute_code for synchronous execution.

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?

Explicit guidance is provided: when to use (async execution), when not (avoid .dat files), and alternatives (pfc_execute_code for synchronous, companion tools for lifecycle). Includes a warning about blocking behavior.

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/yusong652/pfc-mcp'

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