agentic_file_workflow
Execute multi-step file system workflows by gathering context server-side and using LLM sampling to analyze and act on files without additional tools.
Instructions
Execute agentic file workflows using FastMCP 2.14.5+ sampling (no tools).
Gathers file system context server-side, then uses ctx.sample() to have the LLM analyze and reason about it. Compatible with Claude Desktop which supports basic sampling but not sampling.tools capability.
Args: See Parameters block.
Return Format
{"success": bool, "operation": str, "summary": str, "result": {"workflow_prompt", "steps_executed", "results", "notes", "execution_summary"}, "quality_metrics": {...}, "recommendations": [...], "next_steps": [...]} On failure: {"success": false, "error": str, "error_type": str, "recovery_options": [...], "diagnostic_info": {...}}
Recovery: If NO_CONTEXT, run from an MCP client that injects Context. If SAMPLING_ERROR, shorten the prompt or check server logs; verify the host supports ctx.sample().
Examples
agentic_file_workflow(workflow_prompt="Find and summarize all TODO comments in src/", available_tools=["search_ops"]) agentic_file_workflow(workflow_prompt="Rename all .bak files in D:/data to .old", available_tools=["file_ops", "dir_ops"])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_iterations | No | ||
| available_tools | Yes | ||
| workflow_prompt | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||