Commit 76586f4
feat: Add report-problem tool for agents to report issues (#1050)
Implements the `report-problem` MCP tool from #748 — a channel for
agents to report problems with Apify's tools or Actors, so we get signal
on where agents get stuck.
## What's included
- **New tool `report-problem`**: returns a plain-text acknowledgement,
always success. `readOnlyHint: true`, not payment-gated.
Schema:
- `message` — required string, 1–2000 chars. What happened.
- `actorId` — optional string, ≤200 chars.
- `actorRunId` — optional string, ≤200 chars.
- `relatedTools` — optional string[], up to 20 items, each ≤100 chars.
- **Default-enabled `report-problem` tool category** in the registry.
- **Telemetry**: a successful call emits a dedicated `MCP Agent
Feedback` Segment event (fields mapped to snake_case, absent optionals
dropped) alongside the standard tool-call event. Identity handling
mirrors the tool-call event.
## Gating — served only when all three hold
1. **Telemetry enabled.** The tool's only function is forwarding
submissions via telemetry, so it is never served when telemetry is off
(it would just fake an acknowledgement into the void).
2. **Client allowed.** Hidden from Anthropic surfaces (Claude.ai /
Claude Desktop / Claude Code) pending the directory review, via a
substring blocklist (`claude`, `anthropic`) matched against
`clientInfo.name`. The tool cannot be judged until the client is known,
so it is withheld until initialize and added on the flush if the client
allows.
3. **Category selected.** The `report-problem` category is enabled
(default on).
All other tools are unconditionally servable, so recovery loads compose
them eagerly and they survive a load that never sees an initialize; only
`report-problem` is withheld until the client is known.
## Discovery
- **Error nudge**: failed (`isError`) tool results get a report-problem
nudge appended to their text, prompting the agent to report at the
moment it decides what to do next. Full nudge for internal/unknown
errors; a softer nudge for `INVALID_INPUT` (likely the agent's own
mistake); suppressed for expected user-resolvable states (auth,
payment/approval required). Also applied to failed long-running task
results. Never appended when the tool isn't served or when
`report-problem` itself is the failing tool.
- **Server instructions**: a gentle line pointing agents at
`report-problem`, emitted only when the tool is actually served.
## Testing
- **Workflow eval** `report-problem-on-tool-error`: injects a
`call-actor` failure and checks the agent proactively reports the
blocker (rather than only telling the user it failed). Required adding
tool-failure injection to the eval harness.
- **Unit tests**: tool behavior/schema, gating, client blocklist, server
instructions, telemetry event shaping.
- **Integration suite**: `report-problem` listing and gating.
- Manually verified with mcpc: schema, valid/invalid submissions, and
the Anthropic block (filtered from the tool list for a `claude`-family
client while remaining available to non-Anthropic clients).
## TODO
- [ ] Get access to Segment so I can check the reported problems.
Closes #748
---------
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: chris brown <albatrossflyon@gmx.com>
Co-authored-by: Chris Brown <albatrossflyon1@gmail.com>1 parent cbdcaf4 commit 76586f4
27 files changed
Lines changed: 1129 additions & 70 deletions
File tree
- evals
- workflows
- src
- mcp
- tools
- dev
- utils
- server-instructions
- tests
- integration
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
23 | 26 | | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
200 | 209 | | |
201 | 210 | | |
202 | 211 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
0 commit comments