Skip to content

Commit d394f0f

Browse files
RafaelPogithub-actions[bot]
authored andcommitted
fix(futuresearch-mcp): defer polling/results instructions to per-client tool responses (#5066)
## Summary - The MCP system instructions unconditionally told the agent to use `futuresearch_progress` for polling and `futuresearch_results` for output retrieval - On widget-capable clients (Claude Desktop, Claude.ai), this contradicted the per-call tool responses that direct the agent to `futuresearch_status` instead, causing the agent to ignore the widget and double-poll with the wrong tool - Updated workflow steps 3 (Poll) and 4 (Results), plus the HTTP Results section, to defer to the submission/polling tool responses which already branch correctly per client ## Test plan - [ ] Verify on Claude Desktop: after submitting an operation, agent calls `futuresearch_status` and does NOT follow up with `futuresearch_progress` or `futuresearch_results` - [ ] Verify on Claude Code: agent still uses `futuresearch_progress` → `futuresearch_results` flow as before - [ ] Verify on everyrow-cc: same text-only flow as Claude Code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Sourced from commit 118b92bc9b06c67a41a52239fe445cb39f73c16b
1 parent 10c43e9 commit d394f0f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • futuresearch-mcp/src/futuresearch_mcp

futuresearch-mcp/src/futuresearch_mcp/app.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ async def no_auth_http_lifespan(_server: FastMCP):
124124
2. **Submit** — call a processing tool (futuresearch_agent, futuresearch_classify, \
125125
futuresearch_rank, futuresearch_dedupe, futuresearch_merge, futuresearch_forecast). \
126126
It returns a task_id immediately.
127-
3. **Poll** — call `futuresearch_progress(task_id)` repeatedly until the task completes. \
128-
Do NOT add commentary between progress calls — just call again immediately.
129-
4. **Results** — call `futuresearch_results(task_id)` to retrieve the output.
127+
3. **Poll** — follow the instruction in the submission response. It will tell you \
128+
exactly which tool to call next (`futuresearch_status` or `futuresearch_progress`). \
129+
Do NOT override that instruction — use the tool it specifies.
130+
4. **Results** — follow the instruction from the polling tool. If it says results \
131+
are in the widget, do NOT call futuresearch_results. Otherwise, call \
132+
`futuresearch_results(task_id)` to retrieve the output.
130133
131134
## Session and artifact reuse
132135
@@ -174,7 +177,9 @@ def _build_instructions_http() -> str:
174177
- Do NOT pass local file paths to `futuresearch_upload_data` — it will fail in remote mode.
175178
176179
## Results
177-
- Always call `futuresearch_results(task_id, page_size=N)` immediately when the task completes. \
180+
- Follow the instruction from the polling tool. If it says results are in the widget, \
181+
do NOT call futuresearch_results — the widget handles display automatically.
182+
- Otherwise, call `futuresearch_results(task_id, page_size=N)` when the task completes. \
178183
For small tasks ({threshold} or fewer rows), set page_size to the total. \
179184
For larger tasks, set page_size to {threshold} to load the first batch.
180185
- The user always has access to all rows via the table view and download link.

0 commit comments

Comments
 (0)