Skip to content

What the agents return

Each section here is one real run of a research agent: the question as it was typed, the figures of the run, and the report the agent wrote, with each cut marked. The example brief shows one whole report with nothing cut.

  • The first round of the agent evaluation (claude plugin eval) ran on 2026-11-13, in Claude Code 2.1.323, with claude-sonnet-5-5 as the model. It ran one case for each agent, on the text of the agents as it stood that day, before the rule that every citation is written in full and the rule against filling a gap from memory.
  • The index held 14 public GitHub repos, the set the project uses to test comparisons. It is a different set from the repos of the benchmark; the two share one repository.
  • Each case has six checks. The agent called the corpus tools. The report cites owner/repo@sha path:line. It names the license. It ends with a receipt block, one line per source. It ends with the closing line, “Licence classes are automated verdicts, not legal advice.” A judge model reads the report against the case’s own criteria, in three votes, and the majority decides.
  • A run is shown here only when it passed all six checks. The page therefore shows runs that went well, and says nothing about how often a run does. The checks test the form of the report and a judge model’s reading of it; they do not prove each claim true, which is what the receipt lets you check.

The reports are word for word, in English because the engine is English only (FAQ). Two things differ from what the agent wrote. An italic line marks each cut and says which section it hides and how many words. The agent’s headings are set as bold lines, so the contents list holds only the headings written for the docs. Every receipt block is whole. The verdicts in it are automated and are not legal advice. The runs were made separately and each is shown as it came back, so two of them can differ: the corpus-miner run recommends “official mcp 2.x”, and the design-explorer run says “I saw the dependency list for mcp 1.30.0 only, not 2.x”. Check the version against the package’s own releases before you pin one.

4 of the 7 runs of this round passed all six checks, and those are the runs shown here. The others failed a check: usage-finder (the judge); prior-art-researcher (its citations and the judge); precedent-reviewer (the judge). The rule that every citation is written in full and the rule against filling a gap from memory were added to the agents after this round.

Does the pack change what an agent returns? The runs on this page are the with-pack half of a pilot that put the question to 7 cases. Each of the 7 agents of the pack got one case, and each case ran twice on claude-sonnet-5-5 on 2026-11-13: once with the pack installed and once without it. That is 14 runs. The pilot is small on purpose and measures one thing: what the pack changes in the report an agent writes.

Each run is scored on three checks. The report cites its sources as owner/repo@sha path:line, it names the license, and a judge model, given the case’s own criteria, accepts it (three votes, the majority decides). The two receipt checks are left out of both arms, because only the pack tells an agent to write a receipt; every run with the pack passed both. The check that an agent called the corpus tools applies only to runs with the pack, so it is left out too. A source counts as verified when its commit, file and lines resolve in the pinned clone.

With the pack Without the pack
Scored checks passed 17 of 21 2 of 21
Sources cited as owner/repo@sha path:line 178 0
Sources verified 174 0
Cost at list prices $13.54 $2.47
Cost per verified source $0.08 n/a
Turns 301 62
Seconds 7,157 1,121

Each column adds up the 7 cases. Cost per verified source is a column’s cost divided by its verified sources. It reads n/a without the pack because no run cited a source in that form, and a division by zero says nothing.

The gap in checks is the form the pack teaches. Nobody told the agents without the pack to write sources as owner/repo@sha path:line or to name the license, and none of them called a corpus tool, so their score shows what the pack changes in the page. It does not show that a page written without the pack is wrong. The judge also failed every one of those pages, and its criteria ask for cited sources.

The runs with the pack cost more and took longer. The cost is at list prices, and a user pays it from their own limit. Of the 7 runs with the pack, 4 passed every check; the section Runs that failed a check says which ones did not, and where.

What to keep in mind:

  • Each case ran once for each arm, on one model, and the project chose the cases. The counts describe these 14 runs and say nothing about how often an agent passes.
  • The pack was edited after these runs, and the server was a development build, so a rerun would not give these numbers. The pack that ran has the fingerprint 1f0f69fb7780 and the prompts fingerprint d86c3fb91df6 (18 files, 14 prompts).
  • The pilot does not measure how much the pack improves a coding agent’s finished work. That is not measured yet.

You use it before you build something, to see how independent open-source projects solved the same problem.

The agent compares how five Python projects turn their functions into tools over the Model Context Protocol, names the approach all of them share, and says what the corpus could not show.

The question

Use the corpus-miner skill. I am about to build exposing Python functions as tools over the Model Context Protocol (MCP). Before I write any code, find how independent open-source projects did it, and tell me which approach to start from.

The run

Corpus calls
44
Turns
48
Time
1,247 s
Cost
$1.91

The run was on 2026-11-13, on Claude Sonnet 5.5 (claude-sonnet-5-5), in Claude Code 2.1.323.

The cost is the figure the evaluation harness reported at list prices.

  • Called the corpus tools
  • Cites owner/repo@sha path:line
  • Names the license
  • Ends with a receipt block
  • Ends with the closing line
  • A judge model read it against the case’s own criteria

The report

Read the report (783 words shown, 521 words cut)

Bottom line

Start from the official MCP SDK's high-level server. Write your logic as plain, fully type-hinted Python functions, and register them from a create_server() factory. Run stdio first. Let the SDK build each tool's JSON Schema from the function signature. Don't hand-write schemas or a JSON-RPC loop.

All five independent Python servers in the corpus work this way. The only hand-rolled server is Go, and I cover it as the counter-example below.

Scope and limits:

  • Repos: The corpus has 14 repos. Five expose Python functions as MCP tools: github/spec-kit, dograh-hq/dograh, d4vinci/scrapling, microsoft/markitdown and bytedance/deer-flow. I set aside hits that consume MCP tools (client side).
  • SDK source: The SDK's own source isn't indexed. How it derives schemas is therefore inferred from these repos' code and tests.
  • Method: I read source at pinned commits and ran nothing.
  • Citations: Text uses short SHAs. Full commits are in the receipt.

Approaches seen

A. Decorator on a server object (markitdown, spec-kit, deer-flow)

  • microsoft/markitdown@7482c09 packages/markitdown-mcp/src/markitdown_mcp/__main__.py:16-47: a module-level mcp = MCPServer("markitdown") and @mcp.tool() on async def convert_to_markdown(uri: str) -> str. The docstring is the only description (MIT).
  • github/spec-kit@7370e59 src/specify_cli/mcp_server/server.py:40-95: the same decorator inside create_server(*, command_runner, launch_directory). Tests inject a fake runner (tests/specify_cli/mcp_server/test_server.py:72-82).
  • bytedance/deer-flow@35656d6 backend/packages/harness/deerflow/capabilities/business.py:141-178: decorators inside build_server(provider). Constraints live in the hints: Annotated[int, Field(ge=1, le=100)] (:152) and Literal["text", "markdown"] (:164).
  • Trade-off: this is the least code. A module-level server registers at import time and can't take injected dependencies. The factory fixes that, but closure-defined tools can't be called without the server.

B. Explicit registration of plain functions (dograh, spec-kit modules, scrapling)

  • dograh-hq/dograh@5166e40 api/mcp_server/server.py:21-58: tools are ordinary async defs in separate modules. A loop calls mcp.tool(_tool), and shared ToolAnnotations are applied per group. A tracing decorator sits beneath the registration and uses functools.wraps, so the framework still sees the real signature (api/mcp_server/tracing.py:45-87) (BSD-2-Clause).
  • github/spec-kit@7370e59 src/specify_cli/mcp_version.py:124-164 and src/specify_cli/artifacts/mcp_list.py:372-397: each feature has a register(server) function. It calls server.add_tool(fn, name=, description=, annotations=, structured_output=True) and raises on a duplicate name.
  • d4vinci/scrapling@26dc85a scrapling/core/ai/server.py:1003-1109: registers bound methods, e.g. add_tool(_mcp_tool(self.make_request), description=self.make_request.__doc__, ...). The _mcp_tool wrapper (:207-217) turns an allow-list of exception types into ToolError (BSD-3-Clause).
  • Trade-off: functions stay importable, testable and wrappable. You maintain a registration list. spec-kit pins the exact tool list in a test (test_server.py:26-57).

C. Hand-written schema and own dispatch (counter-example)

  • juliusbrussee/caveman@9b68f7e mcp/server.go:22-56: in Go, Tool{Name, Description, InputSchema map[string]any, Handler}. It has its own JSON-RPC loop, message-size caps and a pinned protocol version, 2024-11-05. Panic containment is at :218-220 and :347-352 (Apache-2.0).
  • phodal/routa@9dc7b7b: inputSchema literals typed by hand (src/core/mcp/mcp-tool-executor.ts:1117-1156). Manual list_tools/call_tool has a per-profile allow-list (crates/routa-server/src/api/mcp_routes/rmcp_service.rs:104-143) (MIT). I saw these only as search snippets, not whole files.
  • The one Python case builds Tool(..., input_schema=dict(binding.input_schema)) from a caller-supplied schema (caveman@9b68f7e packages/middleware/python/caveman_middleware/mcp.py:51-110).
  • Inference: schema and handler can drift apart, and you own protocol framing. It pays off only if you can't use an SDK or must pin a protocol version.

Cut here: "What the Python repos agree on", 211 words.

Cut here: "Where they differ, and gotchas the repos documented", 310 words.

Recommendation

I don't know your transport, your clients or your Python floor. I assume a standalone server whose clients are LLM hosts.

  1. SDK: Use official mcp 2.x and bound the version, as markitdown does. Three of the five Python servers use it. Switch to standalone fastmcp only if you must mount inside an existing FastAPI app and read request headers per call (dograh). The corpus doesn't show the Python floor of any release, so check it before you pin.
  2. Functions: Write plain module-level functions with full type hints. Use Annotated[..., Field(...)] for bounds and Literal or an enum for choices. Write the docstring for the model, and don't import the server in these modules.
  3. Registration: Use one create_server(**deps) factory that registers a list of functions. Set annotations per group and raise on duplicate names. Use the bare decorator only for a handful of tools.
  4. Errors: Decide this first. Default to markitdown's and scrapling's approach: ToolError with curated text, and a wrapper that translates only the exception types you list. Adopt spec-kit's structured payload only if clients need machine-readable codes. Avoid private SDK hooks unless you truly need strict rejection of unknown arguments.
  5. Transport: Run stdio with nothing else on stdout. Add HTTP later as stateless, bound to loopback, with a token required.
  6. First tests: Call list_tools() and call_tool() in-process, asserting the schema, one success and one error with no leaked detail. Then add one in-memory client round-trip.

Two things would change this. If you must reject unknown arguments, adopt spec-kit's shim together with its tests. If you can't take an SDK or must pin a protocol version, use the hand-rolled route (caveman).

Every source is class P (permissive). Reuse requires keeping the copyright and licence notice. I've treated all of them as pattern only.

The receipt block

Receipt 35 sources
  1. github/spec-kit@7370e59src/specify_cli/mcp_server/server.py:27-100class P MITpattern only
  2. github/spec-kit@7370e59src/specify_cli/mcp_version.py:124-164class P MITpattern only
  3. github/spec-kit@7370e59src/specify_cli/artifacts/mcp_list.py:281-397class P MITpattern only
  4. github/spec-kit@7370e59tests/specify_cli/mcp_server/test_server.py:22-125class P MITpattern only
  5. github/spec-kit@7370e59tests/specify_cli/artifacts/test_mcp_list.py:904-943class P MITpattern only
  6. github/spec-kit@7370e59tests/specify_cli/artifacts/test_mcp_list.py:1106-1145class P MITpattern only
  7. github/spec-kit@7370e59tests/specify_cli/test_mcp_version.py:321-360class P MITpattern only
  8. github/spec-kit@7370e59docs/reference/mcp.md:11-140class P MITpattern only
  9. github/spec-kit@7370e59.github/security-audit-requirements.txt:367-367class P MITpattern only
  10. dograh-hq/dograh@5166e40api/mcp_server/server.py:21-58class P BSD-2-Clausepattern only
  11. dograh-hq/dograh@5166e40api/mcp_server/tracing.py:45-87class P BSD-2-Clausepattern only
  12. dograh-hq/dograh@5166e40api/mcp_server/tools/workflows.py:34-61class P BSD-2-Clausepattern only
  13. dograh-hq/dograh@5166e40api/mcp_server/auth.py:21-33class P BSD-2-Clausepattern only
  14. dograh-hq/dograh@5166e40api/app.py:54-59class P BSD-2-Clausepattern only
  15. dograh-hq/dograh@5166e40api/tests/support/mcp_mock_server.py:16-100class P BSD-2-Clausepattern only
  16. dograh-hq/dograh@5166e40api/requirements.txt:27-27class P BSD-2-Clausepattern only
  17. d4vinci/scrapling@26dc85ascrapling/core/ai/server.py:195-217class P BSD-3-Clausepattern only
  18. d4vinci/scrapling@26dc85ascrapling/core/ai/server.py:965-1160class P BSD-3-Clausepattern only
  19. d4vinci/scrapling@26dc85atests/ai/test_ai_mcp.py:311-350class P BSD-3-Clausepattern only
  20. d4vinci/scrapling@26dc85apyproject.toml:89-89class P BSD-3-Clausepattern only
  21. microsoft/markitdown@7482c09packages/markitdown-mcp/src/markitdown_mcp/__main__.py:16-135class P MITpattern only
  22. microsoft/markitdown@7482c09packages/markitdown-mcp/tests/test_tool_errors.py:1-70class P MITpattern only
  23. microsoft/markitdown@7482c09packages/markitdown-mcp/tests/test_tool_errors.py:136-149class P MITpattern only
  24. microsoft/markitdown@7482c09packages/markitdown-mcp/tests/test_http_transports.py:98-142class P MITpattern only
  25. microsoft/markitdown@7482c09packages/markitdown-mcp/pyproject.toml:27-27class P MITpattern only
  26. bytedance/deer-flow@35656d6backend/packages/harness/deerflow/capabilities/business.py:19-19class P MITpattern only
  27. bytedance/deer-flow@35656d6backend/packages/harness/deerflow/capabilities/business.py:141-178class P MITpattern only
  28. bytedance/deer-flow@35656d6backend/tests/test_business_plugins.py:104-143class P MITpattern only
  29. bytedance/deer-flow@35656d6backend/uv.lock:2700-2700class P MITpattern only
  30. juliusbrussee/caveman@9b68f7emcp/server.go:22-56class P Apache-2.0pattern only
  31. juliusbrussee/caveman@9b68f7emcp/server.go:218-220class P Apache-2.0pattern only
  32. juliusbrussee/caveman@9b68f7emcp/server.go:347-352class P Apache-2.0pattern only
  33. juliusbrussee/caveman@9b68f7epackages/middleware/python/caveman_middleware/mcp.py:51-110class P Apache-2.0pattern only
  34. phodal/routa@9dc7b7bsrc/core/mcp/mcp-tool-executor.ts:1117-1156class P MITpattern only
  35. phodal/routa@9dc7b7bcrates/routa-server/src/api/mcp_routes/rmcp_service.rs:104-143class P MITpattern only

Licence classes are automated verdicts, not legal advice.

You use it when you are choosing between designs and want a few materially different approaches to one problem, compared across real open-source projects with evidence.

The agent groups real projects by how they expose or consume tools over the Model Context Protocol, says which approach fits a small team on one machine, and lists what to read first and what the corpus could not show.

The question

Use the design-explorer skill: expose or consume tools through the Model Context Protocol. We are a small team, the service runs on one machine, and we prefer few dependencies. Show me the real options.

The run

Corpus calls
45
Turns
51
Time
1,177 s
Cost
$2.13

The run was on 2026-11-13, on Claude Sonnet 5.5 (claude-sonnet-5-5), in Claude Code 2.1.323.

The cost is the figure the evaluation harness reported at list prices.

  • Called the corpus tools
  • Cites owner/repo@sha path:line
  • Names the license
  • Ends with a receipt block
  • Ends with the closing line
  • A judge model read it against the case’s own criteria

The report

Read the report (432 words shown, 1,008 words cut)

Problem: expose tools to MCP clients, or consume tools from MCP servers, in a service on one machine, for a small team that wants few dependencies. You didn't say which direction, so I cover both.

corpus_compare grouped the 14 indexed repos (all class P) into five groups. Its first group (awesome-llm-apps, deer-flow, dograh, spec-kit) matched on docs pages and mixed several mechanisms, so I split it using the code. Counts are by owner and describe this corpus only.

Cut here: "The five approaches", 1,008 words.

What fits you

My picks, from what the code shows:

  • Expose: row 3. It is the only shape with nothing extra to run or secure. There is no port, auth or session store, it needs one dependency, and you can test it with a real handshake.
    • To keep the base install lean, follow scrapling (optional extra) or markitdown (separate package). spec-kit made the SDK a core dependency.
    • Move to row 4 only when several clients must share one live process. Then copy scrapling's defaults or dograh's reuse of your existing API-key auth. Decide stateless (markitdown) or stateful (routa) up front.
  • Consume: row 1 if you already run an agent SDK that accepts server config. archon's MCP code is a config loader with env-var expansion plus a per-SDK translation of the result. Otherwise row 2, starting with per-call sessions and pooling only for stateful servers. Give each session its own owner task, since deer-flow and dograh each ended up there.
  • Row 5 only if the SDK's dependency tree is the real blocker. It trades dependencies for upkeep. Version pinning, framing, caps and protocol tests become yours. pi's client also needed OAuth, retries and process-group kill.
  • One machine: stdio fits both directions. If you spawn consumed servers through npx or uvx, kill the whole process group on close, as pi does.

Tell me the direction and your language, and I'll narrow this to one approach with real call sites.

Read first: 1. github/spec-kit@7370e59 docs/reference/mcp.md:8-47, then tests/specify_cli/mcp_server/test_stdio.py:1-50. 2. bytedance/deer-flow@35656d6 backend/packages/harness/deerflow/mcp/session_pool.py:3-42. 3. coleam00/archon@716bfc1 packages/providers/src/claude/provider.ts:614-653. 4. juliusbrussee/caveman@9b68f7e mcp/server.go:60-200, only if you are weighing no SDK.

Evidence limits:

  • The corpus holds 14 repos, so "backers" is a statement about this corpus, not the ecosystem.
  • corpus_package missed pyproject.toml dependencies. It surfaced spec-kit only through an audit pin file and didn't list scrapling or markitdown, so I read those manifests directly.
  • I saw the dependency list for mcp 1.30.0 only, not 2.x.
  • Tests: I read or searched tests for spec-kit, deer-flow, dograh, routa, caveman and pi. One test-angle search found none for archon's config loader. I did not check the tutorial repo.

The receipt block

Receipt 39 sources
  1. coleam00/archon@716bfc1packages/providers/src/claude/provider.ts:614-653class P MITpattern only
  2. coleam00/archon@716bfc1packages/providers/src/mcp/config.ts:110-149class P MITpattern only
  3. coleam00/archon@716bfc1packages/docs-web/src/content/docs/guides/mcp-servers.md:11-50class P MITpattern only
  4. coleam00/archon@716bfc1packages/providers/src/claude/native-tools.ts:51-70class P MITpattern only
  5. shubhamsaboo/awesome-llm-apps@6c16b23ai_agent_framework_crash_course/google_adk_crash_course/4_tool_using_agent/4_4_mcp_tools/filesystem_agent/agent.py:15-54class P Apache-2.0pattern only
  6. shubhamsaboo/awesome-llm-apps@6c16b23mcp_ai_agents/multi_mcp_agent_router/agent_forge.py:161-200class P Apache-2.0pattern only
  7. bytedance/deer-flow@35656d6backend/packages/harness/deerflow/mcp/session_pool.py:3-42class P MITpattern only
  8. bytedance/deer-flow@35656d6backend/uv.lock:2700-2719class P MITpattern only
  9. bytedance/deer-flow@35656d6backend/tests/test_mcp_session_pool.py:714-753class P MITpattern only
  10. bytedance/deer-flow@35656d6backend/tests/test_mcp_cwd.py:11-50class P MITpattern only
  11. dograh-hq/dograh@5166e40api/services/workflow/mcp_tool_session.py:1-120class P BSD-2-Clausepattern only
  12. dograh-hq/dograh@5166e40api/app.py:151-190class P BSD-2-Clausepattern only
  13. dograh-hq/dograh@5166e40api/requirements.txt:27-27class P BSD-2-Clausepattern only
  14. dograh-hq/dograh@5166e40api/tests/support/mcp_mock_server.py:1-40class P BSD-2-Clausepattern only
  15. github/spec-kit@7370e59docs/reference/mcp.md:8-47class P MITpattern only
  16. github/spec-kit@7370e59src/specify_cli/mcp_server/server.py:1-58class P MITpattern only
  17. github/spec-kit@7370e59pyproject.toml:7-18class P MITpattern only
  18. github/spec-kit@7370e59tests/specify_cli/mcp_server/test_stdio.py:1-50class P MITpattern only
  19. github/spec-kit@7370e59design/mcp.md:443-454class P MITpattern only
  20. d4vinci/scrapling@26dc85adocs/api-reference/mcp-server.md:11-50class P BSD-3-Clausepattern only
  21. d4vinci/scrapling@26dc85apyproject.toml:63-92class P BSD-3-Clausepattern only
  22. d4vinci/scrapling@26dc85adocs/ai/mcp-server.md:265-304class P BSD-3-Clausepattern only
  23. microsoft/markitdown@7482c09packages/markitdown-mcp/README.md:3-42class P MITpattern only
  24. microsoft/markitdown@7482c09packages/markitdown-mcp/pyproject.toml:27-27class P MITpattern only
  25. microsoft/markitdown@7482c09packages/markitdown-mcp/src/markitdown_mcp/__main__.py:62-101class P MITpattern only
  26. phodal/routa@9dc7b7bcrates/routa-server/src/api/mcp_routes/rmcp_service.rs:69-108class P MITpattern only
  27. phodal/routa@9dc7b7bcrates/routa-core/Cargo.lock:1697-1727class P MITpattern only
  28. phodal/routa@9dc7b7bsrc/app/api/mcp/route.ts:8-47class P MITpattern only
  29. phodal/routa@9dc7b7bapps/desktop/src-tauri/tests/api_test.rs:403-442class P MITpattern only
  30. phodal/routa@9dc7b7bsrc/app/workspace/[workspaceId]/sessions/[sessionId]/use-session-mcp-tool.ts:51-82class P MITpattern only
  31. phodal/routa@9dc7b7bscripts/mcp-http-proxy.mjs:17-56class P MITpattern only
  32. juliusbrussee/caveman@9b68f7emcp/server.go:1-200class P Apache-2.0pattern only
  33. juliusbrussee/caveman@9b68f7emcp/server_test.go:661-700class P Apache-2.0pattern only
  34. juliusbrussee/caveman@9b68f7epackages/cli/src/agent-mcp.ts:608-647class P Apache-2.0pattern only
  35. juliusbrussee/caveman@9b68f7emcp/CLAUDE.md:3-42class P Apache-2.0pattern only
  36. earendil-works/pi@8ffea8apackages/mcp/README.md:1-60class P MITpattern only
  37. earendil-works/pi@8ffea8apackages/mcp/package.json:53-55class P MITpattern only
  38. earendil-works/pi@8ffea8apackages/coding-agent/docs/mcp.md:96-110class P MITpattern only
  39. earendil-works/pi@8ffea8apackages/mcp/test/stdio.test.ts:11-50class P MITpattern only

Licence classes are automated verdicts, not legal advice.

You use it before you paste or ship a snippet of unknown origin, to learn where it comes from, under which license, and what notice it needs.

The agent finds the exact source of a six-line function, reads its license, says what notice to keep, and states what it could not check. Its answer to “Can you ship it?” is an automated verdict, not legal advice.

The question

Use the provenance-guard skill. Where does this code come from, and can I ship it in our product?

def check_plugins_enabled() -> bool:
    return os.getenv("MARKITDOWN_ENABLE_PLUGINS", "false").strip().lower() in (
        "true",
        "1",
        "yes",
    )

The run

Corpus calls
11
Turns
15
Time
179 s
Cost
$0.37

The run was on 2026-11-13, on Claude Sonnet 5.5 (claude-sonnet-5-5), in Claude Code 2.1.323.

The cost is the figure the evaluation harness reported at list prices.

  • Called the corpus tools
  • Cites owner/repo@sha path:line
  • Names the license
  • Ends with a receipt block
  • Ends with the closing line
  • A judge model read it against the case’s own criteria

The report

Read the report (348 words shown, 182 words cut)

Verdict: identical. Your snippet matches check_plugins_enabled() in Microsoft's MarkItDown line for line, formatting included.

Licence: MIT (class P, permissive)

  • Where it comes from: the root LICENSE reads "Copyright (c) Microsoft Corporation." packages/markitdown-mcp/pyproject.toml declares license = "MIT".
  • What I didn't find: that package has no LICENSE of its own, and __main__.py has no per-file header.
  • Sibling files: other files in the package carry SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>.

Can you ship it?

On the automated verdict, yes, including in a proprietary product. MIT has no copyleft or share-alike terms, so it doesn't reach the rest of your code. The one condition is that you keep the copyright and permission notice with the copied code.

Whether six lines count as a "substantial portion" is a legal call I can't make. Keeping the notice is cheap and avoids the question.

  1. Add the notice below to your third-party notices file and ship it with the product.
  2. Optionally add a comment at the function: # From microsoft/markitdown, packages/markitdown-mcp/src/markitdown_mcp/__main__.py (MIT, Copyright (c) Microsoft Corporation).

If you'd rather not carry a notice, write your own version of the idea, which is parsing a boolean env flag. Use your own variable name. That would be pattern only, with nothing copied.

Cut here: "Notice to keep", 182 words.

Limits

A match is evidence, not a legal finding. The licence verdicts are automated and are not legal advice. The search covered the 14 repos in the index. All 138 files of the matched repo were searchable, and none were skipped. I can't see copies outside the index, and the corpus holds no history, so I can't say when upstream introduced the function.

The receipt block

Receipt 1 source
  1. microsoft/markitdown@7482c09packages/markitdown-mcp/src/markitdown_mcp/__main__.py:50-55class P MITcopied with noticenotice: Copyright (c) Microsoft Corporation., MIT License

Licence classes are automated verdicts, not legal advice.

Finding how projects test something with test-scout

Section titled “Finding how projects test something with test-scout”

You use it before you write tests, to see how real open-source projects test the same behavior: the cases they cover and how they fake time, the network and randomness.

The agent reads the tests of real projects that retry a failed request, returns a checklist of cases for your own tests, and says what no test it found pins down.

The question

Use the test-scout skill: retrying a failed LLM or HTTP request with exponential backoff. Before I write my tests, show me how real projects test it.

The run

Corpus calls
33
Turns
37
Time
998 s
Cost
$2.03

The run was on 2026-11-13, on Claude Sonnet 5.5 (claude-sonnet-5-5), in Claude Code 2.1.323.

The cost is the figure the evaluation harness reported at list prices.

  • Called the corpus tools
  • Cites owner/repo@sha path:line
  • Names the license
  • Ends with a receipt block
  • Ends with the closing line
  • A judge model read it against the case’s own criteria

The report

Read the report (899 words shown, 1,174 words cut)

Test scout: retrying a failed LLM/HTTP request with exponential backoff

Behavior: a client retries a failed LLM or HTTP call with growing, capped, usually jittered waits. It retries only transient failures, honours Retry-After, and stops after a bounded number of attempts.

Scope: I searched 14 indexed repos and read about 25 test files. All of them are class P (MIT, Apache-2.0, BSD-3-Clause), and I'm describing patterns only. Every retry loop I found is hand-written application code, in Python/pytest or TypeScript/vitest. The Go hits are gateway code, so adjacent. Searches restricted to repos that depend on tenacity and p-retry still returned hand-rolled loops. I have nothing on testing library-wrapped retries, and I didn't check whether those repos call the libraries directly. SHAs are shortened to 7 characters below. The receipt block has the full ones.

Bottom line: make sleep, the clock and the jitter RNG injectable. Table-test the delay calculator on its own. Test the loop with a recording sleep, and use a virtual clock only for deadline and cancellation tests. In these files, the tests labelled as regressions mostly concern Retry-After parsing, caps and deadlines, error classification and abort. They rarely concern the doubling itself.

Cut here: "Four ways they test it", 906 words.

Checklist for your tests (union of what they pin)

  1. Retry is opt-in. By default there is a single attempt, no sleep, and no RNG draw (Jina, Serper, pi).
  2. Success on the first try means 1 call and no sleep.
  3. N transient failures then success means N+1 calls. Parametrize over 502/503/504, connection error and connect timeout (Jina).
  4. Exhaustion makes exactly 1 + max_retries calls. Decide whether your knob counts attempts or retries (Jina 6 → 7, middleware 2 → 2).
  5. Pin what giving up returns. I saw a raised error, an error string, an error dict, None, a fallback message, and an error-typed result.
  6. Non-retryable errors make exactly 1 call and no sleep. That covers 400/401/403/404 and quota or billing errors (pi insufficient_quota). Tests also pin each project's own policy: Jina treats a 429 without a valid Retry-After as terminal, and also treats 500 as terminal. That is a choice, not a rule.
  7. If you classify by message text, test false positives. A status code inside a request id or a byte count must not match (pi, regression for #11057).
  8. The delay schedule is exact with the jitter pinned. Test the first delay, the doubling, the cap held, and 1-based vs 0-based attempt indexing.
  9. Jitter: one fresh draw per retry, the right window, and it never shortens a server-provided floor.
  10. Retry-After: seconds, milliseconds, HTTP-date, past or negative, 0, nan/inf/huge, "1, 2". For an absurdly long hint, pick one behaviour and pin it: clamp, fail fast (pi's error Server requested 277403s retry delay (max: 1s)), or fall back to the local schedule.
  11. Budget and deadline: shared across attempts and sleeps, per-request timeout shrinks, no request after the deadline, and an overshooting sleep is handled.
  12. Cancellation during the request and during the backoff sleep. No further call, the timer is cleared, CancelledError is not swallowed as retryable, and a pre-aborted signal makes 0 calls.
  13. The retried request is identical to the original: same body and headers (Serper), same endpoint and key after a config reload (Serper), same prompt on both attempts (caveman, a gateway).
  14. No stacked retry layers: the SDK's own retries are set to 0, so your count is exact. This is pinned in deer-flow and pi. caveman asserts a proxy's replay doesn't multiply the client's retries.
  15. Streaming: decide what is retried mid-stream. deer-flow pins "retried from the start, and tokens already streamed are not taken back". It also pins that terminal SSE error events do not retry, with a sleep that calls pytest.fail as a tripwire.
  16. A concurrency slot is released while parked in backoff (deer-flow).
  17. Invalid config such as a negative count, a bool, NaN or a zero budget sends no request.
  18. Diagnostics: one summary record per call, no secrets, URL or body in logs, and no "retrying…" log on the final attempt.
  19. Clients and transports are closed after every outcome (Serper asserts it).

Cut here: "Traps: time, order, network, randomness", 268 words.

What no test I found pins down

  • First vs last error: I found no test where successive attempts raise different errors and the assertion shows which one surfaces. I searched the whole corpus (14 repos, top 8 hits) for "retries exhausted raises the last error not the first". The nearest is Serper's budget-exhaustion diagnostic, which asserts the last error but has only one failing outcome, so it can't tell first from last. Every exhaustion test I read repeats the same error.
  • Backoff schedule in archon: I found nothing pinning the Claude provider's doubling or the GitHub and Gitea adapters' linear default. The searches are listed under approach 3.
  • Client-side Idempotency-Key stable across retry attempts: a corpus-wide search found only server-side idempotency tests in deer-flow and caveman's logical-call ids. The nearest in-loop case is that Serper and caveman's hardening.test.mjs pin identical retried requests.
  • Partial output on retry in pi: pi classifies mid-stream drops as retryable, but a corpus-wide search for "partial output discarded on retry" found no pi test of what happens to the partial content. Only deer-flow pins it.

Tell me your language and test runner, and whether you own the retry loop or wrap an SDK. I can then sketch the test file for your stack.

The receipt block

Receipt 33 sources

Licence classes are automated verdicts, not legal advice. Every source below is pattern only.

  1. bytedance/deer-flow@35656d6backend/tests/test_jina_retries.py:22-232class P MITpattern only
  2. bytedance/deer-flow@35656d6backend/tests/test_jina_retry_after.py:105-206class P MITpattern only
  3. bytedance/deer-flow@35656d6backend/tests/test_serper_retries.py:15-215class P MITpattern only
  4. bytedance/deer-flow@35656d6backend/tests/test_codex_retry_after.py:14-53class P MITpattern only
  5. bytedance/deer-flow@35656d6backend/tests/test_codex_retry_after.py:101-140class P MITpattern only
  6. bytedance/deer-flow@35656d6backend/tests/test_claude_provider_retry_after.py:11-59class P MITpattern only
  7. bytedance/deer-flow@35656d6backend/tests/test_claude_retry_after_dates.py:14-58class P MITpattern only
  8. bytedance/deer-flow@35656d6backend/tests/test_llm_error_handling_middleware.py:365-404class P MITpattern only
  9. bytedance/deer-flow@35656d6backend/tests/test_llm_error_handling_middleware.py:1717-1756class P MITpattern only
  10. bytedance/deer-flow@35656d6backend/tests/test_llm_error_handling_middleware.py:1910-1998class P MITpattern only
  11. bytedance/deer-flow@35656d6backend/tests/test_llm_error_handling_middleware.py:3413-3452class P MITpattern only
  12. bytedance/deer-flow@35656d6backend/tests/test_model_request_admission.py:307-346class P MITpattern only
  13. bytedance/deer-flow@35656d6backend/tests/test_codex_stream_terminal_events.py:104-143class P MITpattern only
  14. bytedance/deer-flow@35656d6backend/tests/test_jina_diagnostics.py:53-92class P MITpattern only
  15. bytedance/deer-flow@35656d6backend/tests/test_jina_response_limit.py:159-198class P MITpattern only
  16. bytedance/deer-flow@35656d6tests/skills/test_podcast_generation.py:29-30class P MITpattern only
  17. bytedance/deer-flow@35656d6tests/skills/test_podcast_generation.py:217-256class P MITpattern only
  18. earendil-works/pi@8ffea8apackages/ai/test/retry.test.ts:18-326class P MITpattern only
  19. earendil-works/pi@8ffea8apackages/ai/test/provider-retry.test.ts:1-89class P MITpattern only
  20. earendil-works/pi@8ffea8apackages/ai/test/openai-completions-retry.test.ts:1-140class P MITpattern only
  21. earendil-works/pi@8ffea8apackages/chord/test/next/host/object.test.ts:160-199class P MITpattern only
  22. harry0703/moneyprinterturbo@4318f3atest/services/test_ofox.py:416-543class P MITpattern only
  23. harry0703/moneyprinterturbo@4318f3atest/services/test_llm.py:2853-2892class P MITpattern only
  24. tauricresearch/tradingagents@c454491tests/test_reddit_fallback.py:93-136class P Apache-2.0pattern only
  25. coleam00/archon@716bfc1packages/adapters/src/forge/github/adapter.test.ts:1354-1368class P MITpattern only
  26. coleam00/archon@716bfc1packages/adapters/src/community/forge/gitea/adapter.test.ts:678-697class P MITpattern only
  27. coleam00/archon@716bfc1packages/providers/src/claude/provider.test.ts:82-82class P MITpattern only
  28. coleam00/archon@716bfc1packages/providers/src/claude/provider.test.ts:3044-3054class P MITpattern only
  29. coleam00/archon@716bfc1packages/providers/src/claude/provider.ts:1586-1586class P MITpattern only
  30. coleam00/archon@716bfc1packages/adapters/src/forge/github/adapter.ts:212-212class P MITpattern only
  31. d4vinci/scrapling@26dc85atests/spiders/test_throttle.py:121-160class P BSD-3-Clausepattern only
  32. juliusbrussee/caveman@9b68f7eproxy/internal/gateway/route_test.go:853-892class P Apache-2.0pattern only
  33. juliusbrussee/caveman@9b68f7epackages/middleware/typescript/tests/hardening.test.mjs:340-360class P Apache-2.0pattern only

Licence classes are automated verdicts, not legal advice.