Alexandria routing copy: name the catalogue, keep search as the front door, make sources opt-out explicit - #424
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Rewrites Alexandria routing copy and tool descriptions to make sources opt-out explicit and steer scrape-first tasks to search, plus a test update. It intentionally changes agent routing toward provider matches, a product/operational tradeoff needing human sign-off.
Re-trigger cubic
…ront door, make sources opt-out explicit Server instructions, firecrawl_search and firecrawl_find_tools descriptions, and the sources parameter description rewritten from what agents did in 364 AX traces: name Alexandria and its verticals through shared constants, say when a provider beats a page, state that passing sources without alexandria (including ["news"]) excludes provider matches, and give scrape-first tasks a pointer to run one search with sources unset (authenticated sessions only). Tool identifier unchanged. Smoke test pins the catalogue opener, the sources rule and the scrape-first rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
7eb817e to
6b3055a
Compare
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 5/5
- In
src/index.ts, the duplicated Alexandria mode paragraph makes thefirecrawl_scrapedescription unnecessarily repetitive, but it does not affect runtime behavior; remove the repeated line to keep the description clear.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/index.ts">
<violation number="1" location="src/index.ts:2452">
P2: The added line repeats the existing "Alexandria mode: pass `alexandria` ..." paragraph, so the firecrawl_scrape description now contains that paragraph twice (lines 2452–2453, the pre-existing line additionally carries the feedbackTool pointer sentence). This duplicate is emitted on every tools/list to every full-profile client, doubling that paragraph's tokens and diluting the routing copy this PR is meant to clarify. Delete the added line; the pre-existing full paragraph below it already covers the Alexandria mode.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| Returns the selected content formats and page metadata. Authenticated responses can include a \`metadata.scrapeId\` for optional scrape feedback. | ||
|
|
||
| On an authenticated session with Alexandria access, if you are about to scrape the same fields from several pages, first run \`firecrawl_search\` with \`sources\` unset (or \`firecrawl_find_tools\`): a matching Alexandria provider returns those fields as typed records in one call. Keyless sessions have no provider matches; scrape directly. | ||
| Alexandria mode: pass \`alexandria\` (one \`{provider, capability, options}\` object or an array of 1-10) instead of \`url\` to execute catalogued Alexandria capabilities found through \`firecrawl_search\` sources \`alexandria\` or \`firecrawl_find_tools\`. The optional requestId identifies one logical execution: reuse the returned ID for retries of the identical payload, never a new ID to bypass pending or uncertain execution. Each call may include version to pin a published workflow; omitting it uses latest. Only timeout also applies at the top level in this mode. Returns per-capability results in \`data.alexandria\`, including \`data\`, \`records\`, or an \`error\` with a code. Check each item for errors even when the outer response is successful. Alexandria needs an API key on a team with Alexandria enabled. |
There was a problem hiding this comment.
P2: The added line repeats the existing "Alexandria mode: pass alexandria ..." paragraph, so the firecrawl_scrape description now contains that paragraph twice (lines 2452–2453, the pre-existing line additionally carries the feedbackTool pointer sentence). This duplicate is emitted on every tools/list to every full-profile client, doubling that paragraph's tokens and diluting the routing copy this PR is meant to clarify. Delete the added line; the pre-existing full paragraph below it already covers the Alexandria mode.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/index.ts, line 2452:
<comment>The added line repeats the existing "Alexandria mode: pass `alexandria` ..." paragraph, so the firecrawl_scrape description now contains that paragraph twice (lines 2452–2453, the pre-existing line additionally carries the feedbackTool pointer sentence). This duplicate is emitted on every tools/list to every full-profile client, doubling that paragraph's tokens and diluting the routing copy this PR is meant to clarify. Delete the added line; the pre-existing full paragraph below it already covers the Alexandria mode.</comment>
<file context>
@@ -2444,6 +2448,8 @@ Firecrawl may reuse recently indexed content instead of refetching the page, and
Returns the selected content formats and page metadata. Authenticated responses can include a \`metadata.scrapeId\` for optional scrape feedback.
+On an authenticated session with Alexandria access, if you are about to scrape the same fields from several pages, first run \`firecrawl_search\` with \`sources\` unset (or \`firecrawl_find_tools\`): a matching Alexandria provider returns those fields as typed records in one call. Keyless sessions have no provider matches; scrape directly.
+Alexandria mode: pass \`alexandria\` (one \`{provider, capability, options}\` object or an array of 1-10) instead of \`url\` to execute catalogued Alexandria capabilities found through \`firecrawl_search\` sources \`alexandria\` or \`firecrawl_find_tools\`. The optional requestId identifies one logical execution: reuse the returned ID for retries of the identical payload, never a new ID to bypass pending or uncertain execution. Each call may include version to pin a published workflow; omitting it uses latest. Only timeout also applies at the top level in this mode. Returns per-capability results in \`data.alexandria\`, including \`data\`, \`records\`, or an \`error\` with a code. Check each item for errors even when the outer response is successful. Alexandria needs an API key on a team with Alexandria enabled.
Alexandria mode: pass \`alexandria\` (one \`{provider, capability, options}\` object or an array of 1-10) instead of \`url\` to execute catalogued Alexandria capabilities found through \`firecrawl_search\` sources \`alexandria\` or \`firecrawl_find_tools\`. The optional requestId identifies one logical execution: reuse the returned ID for retries of the identical payload, never a new ID to bypass pending or uncertain execution. Each call may include version to pin a published workflow; omitting it uses latest. Only timeout also applies at the top level in this mode. Returns per-capability results in \`data.alexandria\`, including \`data\`, \`records\`, or an \`error\` with a code. Check each item for errors even when the outer response is successful. Alexandria needs an API key on a team with Alexandria enabled. Alexandria results include a \`feedbackTool\` pointer: after the task, report how the catalogue served the website through \`firecrawl_feedback\` with endpoint \`alexandria\` (free, no job ID).
</file context>
The only conflict was the rewritten profile instructions; main's text is kept with the threadId sentence re-appended. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Stacked on #405. Copy-only changes to the Alexandria routing text, plus one stale test assertion.
What changed
FULL_PROFILE_INSTRUCTIONS): the sentence "For structured records, filterable listings, transcripts, or datasets, first check firecrawl_find_tools…" is replaced by a description of what Alexandria is (data providers and workflows across companies, people, jobs, finance and filings, public records, real estate, places, retail and prices, developer data, news, research), when a provider beats scraping a page (same fields across several entities, provenance, exact figures, many records), an ordering rule ("before scraping more than one page for the same fields, spend one free find_tools call"), and an explicit statement that passingsources(including["news"]) excludes provider matches. Search stays the front door; web results that already answer the question are used as they are.firecrawl_find_toolsdescription: opens with what the catalogue covers, keeps "Prefer normal firecrawl_search for a data task", and adds the scrape-first trigger. Identifier and title unchanged.firecrawl_searchsourcesdescription: "Passing sources excludes Alexandria provider matches, including sources: ["news"]; omit it unless you specifically need web-only or news-only results."ALEXANDRIA_INSTRUCTIONS(search tool description): same framing, same vertical list, same sources statement.firecrawl_scrapedescription: one line pointing scrape-first tasks at a search withsourcesunset.Why these and not a rename
From the AX harness runs on this branch (EXP-053, 364 traces, Claude Code and Codex, 20 real tester queries; findings in firecrawl/agent-experience
experiments/EXP-053-alexandria-mcp*.findings.md):firecrawl_find_toolstofirecrawl_alexandriaorfirecrawl_data_providersdid not move bare-prompt routing. Claude Code only reaches a deferred MCP tool by keyword search or exact select, and its keyword queries are always verb-shaped ("firecrawl scrape search"); Codex made zero Firecrawl calls on any bare prompt regardless of name. So the identifier stays.sourcesopt-out was the mechanical blocker: on the earlier build agents passedsources: ["web"]on 300/350 searches and never saw a tools block. Theca120bcdefault wording fixed this for Claude (omits on 37/50 calls, and the tools block converted in 7 of 8 traces that received it) but not for Codex (suppliedsourceson 291/291 calls, never omitted). This copy says what supplying the argument costs rather than what omitting it gives, and covers["news"], which suppressed the fitting provider on every portfolio-news trace.firecrawl_scrapeon a known URL; the scrape description line is the only text that reaches them.Not in this PR
Two ergonomics bugs that cost calls in five traces:
firecrawl_find_toolsrejects a fully-qualified capability id (capabilities: ["zillow-com/properties/rental_search"]→invalid_option) although browse returns ids in that form; andsources: ["alexandria"]withtoolDetail: "full"returns 59–80k characters and overflows the client token limit.🤖 Generated with Claude Code
Summary by cubic
Rewrites the Alexandria routing copy in the server instructions and the
firecrawl_search,firecrawl_find_tools, andfirecrawl_scrapedescriptions, based on 364 agent harness traces. The copy names the catalogue and its verticals, states that passingsourceswithoutalexandriain it excludes provider matches (includingsources: ["web"]or["news"]), and points scrape-first tasks at one search withsourcesunset. Search stays the front door; the tool identifier is unchanged. Also fixes the smoke-test assertion the copy change left stale and bumps the version to 3.25.2.Routing rationale
firecrawl_find_toolsnever moved bare-prompt routing: Claude Code only reaches deferred MCP tools by keyword search, and Codex made no Firecrawl calls regardless of name.sourceswas the mechanical blocker — agents passedsources: ["web"]on most searches and never saw the tools block — so the copy says what supplying the argument costs rather than what omitting it gives.Review changes
alexandria; mixed lists that include it stay valid.find_toolscall rule.Written for commit 4e06782. Summary will update on new commits.