docs(examples): add reference browser tool definitions for custom tools - #379
Merged
Merged
Conversation
#364 lets a caller serve its own tools, but the documented example was abstract. These are the eight browser tools the feature was evaluated with -- four navigation, four DOM -- in the shape the API expects, so a user can paste them into `tools=` and implement `run_custom_tool` against a known-good schema. Data and docs only; nothing imports this file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHkcDvvjaw6TNukT99af2o
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.
Problem
#364 lets a caller serve its own tools through
N2ComputerAgent(tools=[...]), but left the reader to invent the definitions. The shape is easy to get subtly wrong — a schema the server rejects, or one the model reads as something other than what the adapter implements.Change
examples/browser_tools.json: the eight browser tools the feature was evaluated with, in the shape the API expects.goto_url,go_back,go_forward,refreshextract_elements,find,set_element_value,execute_jsThese are ordinary caller tools — nothing here is served by the built-in tool set. The adapter implements
run_custom_tool(name, arguments); the agent handles routing, results and frames.Data and docs only. Nothing imports the file, and no runtime behaviour changes.
Notes for the reviewer
Two things worth a look, since this is a public repo:
set_element_valueis not independently useful. Itsrefargument only means something alongsideextract_elements, which issues the references. The README says to serve the subset you implement; the DOM four travel together in practice.Generated from the praxis navigator constants the evaluation actually served, so the file cannot drift from what was measured.
Testing
920 passed, 3 skippedon the full suite; the JSON parses and carries all eight definitions.🤖 Generated with Claude Code
https://claude.ai/code/session_01PHkcDvvjaw6TNukT99af2o
Note
Low Risk
Docs and static JSON only; no production code paths or behavioral changes.
Overview
Adds
examples/browser_tools.json, a copy-pasteable set of eight OpenAI-style function tool schemas for browser control viaN2ComputerAgent(tools=[...]): navigation (goto_url,go_back,go_forward,refresh) and DOM helpers (extract_elements,find,set_element_value,execute_js).examples/README.mdgains abrowser_tools.jsonsection that explains these are caller-defined tools (adapter implementsrun_custom_tool, not built-in model tools), shows loading the JSON into the agent, and notes you can ship only the tools your adapter supports.Documentation and example data only — nothing imports the file and runtime behavior is unchanged.
Reviewed by Cursor Bugbot for commit 70417d1. Bugbot is set up for automated code reviews on this repo. Configure here.