Browser Tool Calling Interface and JSON Schema Specification
Design production-ready, strict JSON Schema tool definitions for autonomous web-browsing agent interfaces.
Use this template when building client-facing web agents that need deterministic tool-calling contracts for DOM manipulation, network fetching, and session management. It ensures schema strictness, input validation boundaries, and explicit error handlers.
Role: Senior Web Integration Engineer specializing in autonomous agent tool-calling protocols and client-side execution boundaries.
Context
- Target web application: {{target_web_app}}
- Agent runtime framework: {{agent_framework}}
- Supported action types: {{tool_action_types}}
- Authentication and session handling: {{auth_handling_strategy}}
- Execution and retry budget: {{error_retry_budget}}
Task
Draft a formal technical specification defining strict JSON Schema tool definitions and client-side execution contracts for an autonomous web agent interacting with {{target_web_app}} via {{agent_framework}}.
Method
- Analyze the functional requirements for {{tool_action_types}} within the context of {{target_web_app}}.
- Define deterministic tool names, descriptions, and strict JSON Schema properties for each action without ambiguous parameters.
- Incorporate parameter constraints including regex validation patterns, enums, and explicit boundary limits.
- Design the request-response lifecycle between the {{agent_framework}} dispatcher and the client-side execution bridge.
- Establish {{auth_handling_strategy}} guardrails to prevent unauthorized session token leakage through tool arguments.
- Specify concrete error objects and recovery codes tailored to {{error_retry_budget}}.
- Map runtime schema validation hooks using standard JSON schema validation patterns.
Constraints
- MUST adhere to strict OpenAPI 3.1 / JSON Schema Draft-07 format for all parameter declarations.
- MUST NOT leave optional parameters without explicit default values or nullable types.
- Tool signatures MUST separate destructive mutating calls from read-only inspection calls.
- Error responses MUST include actionable remediation payloads for LLM consumption.
Output format
- Section 1: Tool Registry Architecture Overview (max 250 words)
- Section 2: Complete Tool Definition Declarations (valid JSON Schema definitions for each action in {{tool_action_types}})
- Section 3: Session and Auth Bridge Contract (auth boundaries using {{auth_handling_strategy}})
- Section 4: Error Handling and Fallback Code Matrix (structured table with codes, triggers, and retry logic based on {{error_retry_budget}})
Self-review
- Are all tool parameters strictly typed with zero ambiguous wildcard objects?
- Does the authentication strategy explicitly isolate sensitive credentials from tool call arguments?
- Is every step in {{error_retry_budget}} mapped directly to a machine-readable error recovery schema?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.