Enhance tool descriptions and validations - #330
Open
erikengervall wants to merge 7 commits into
Open
Conversation
…arch modules - Improved descriptions for various parameters in the search query and monitor creation functions to provide clearer guidance on usage. - Added validation and descriptive messages for parameters in the research tools, enhancing user understanding of input requirements. - Updated the `FULL_PROFILE_INSTRUCTIONS` and `SEARCH_PROFILE_INSTRUCTIONS` to reflect a more accurate representation of tool capabilities and usage. - Introduced a new function to preserve parameter descriptions for better schema management. - Enhanced test cases to ensure descriptions are specific and free from non-neutral metadata patterns.
Rewrite tool descriptions purpose-first so each one leads with what the tool does and the input it needs, and state the concrete return shape. - Name return shapes: URL lists, JSON monitor and check records, parse formats, extraction data, job ids, text and markdown for research. - Restore search feedback economics: first accepted feedback per search id returns 1 credit of the 2 a search costs, the roughly two minute window, idempotency, and the daily cap signal. - Correct firecrawl_monitor_update to state that patch fields nest inside body, matching its schema. - Correct firecrawl_agent_status to the actual processing, completed, and failed states. - State that firecrawl_interact side effects persist after the session ends, which is what its destructive annotation reflects. - Document firecrawl_search highlights and scrapeOptions as optional, and enumerate parse formats and monitor check page statuses. - Generalize research paper search wording so it stays accurate as coverage expands, and scope GitHub search to public issues, pull requests, and readmes. - Drop restatements of behavior already implied by a tool's name.
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Zod 4 deprecates the string-method format validators in favor of top-level schemas. Its own typings carry the notices, for example "@deprecated Use z.url() instead". Replace every affected call site so the codebase stays on current Zod conventions and emits no deprecation warnings: - z.string().url() to z.url() across scrape, map, crawl, extract, agent, interact, feedback, and monitor parameters. - z.string().email() to z.email() for the monitor summary recipient. - z.string().uuid(message) to z.uuid(message) for the search and job identifiers, preserving the custom messages. The interact url dropped an explicit .trim() because z.url() already trims. A differential check over padded, tabbed, empty, and invalid inputs found no behavioral divergence. The generated tools/list payload is byte identical before and after, so no input schema or published tool metadata changes.
Models often send "" for unused monitor/interact optionals. Treat blanks as omitted so z.url()/z.email() validation matches prior unset behavior, and trim interact URLs before validating.
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Align blankToUndefined with interact: return trimmed non-blank values so padded emails pass z.email(), and trim pages list entries the same way.
buildMonitorCreateBody already returns body alone; drop other keys before schema validation so invalid empty shorthand cannot fail advanced creates.
Empty queries arrays from clients no longer fail monitor create, and tools/list schemas are generated with Zod io:input so defaults stay optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FULL_PROFILE_INSTRUCTIONSandSEARCH_PROFILE_INSTRUCTIONSto reflect a more accurate representation of tool capabilities and usage.Tool descriptions
Tool descriptions now lead with what each tool does and the input it needs, then state the concrete return shape: URL lists, JSON monitor and check records, parse formats, extraction data, job ids, and text or markdown for research.
Behavioral detail callers depend on is stated explicitly:
firecrawl_search_feedbackdocuments the credit behavior: the first accepted feedback per search id returns 1 credit of the 2 a search costs, within roughly two minutes, idempotent per id, with a daily cap signal.firecrawl_monitor_updatedocuments that patch fields nest insidebody, matching its schema.firecrawl_agent_statusdocuments the realprocessing,completed, andfailedstates.firecrawl_interactstates that side effects persist after the session ends, which is what its destructive annotation reflects.firecrawl_searchdocuments optionalhighlightsandscrapeOptions;firecrawl_parseenumerates its formats;firecrawl_monitor_checkenumerates page statuses.Research paper search wording is generalized so it stays accurate as coverage expands, and GitHub search is scoped to public issues, pull requests, and readmes.