Docs & technical writing
AuraScore 81/100

Agent Function Calling Specification and Harness Generator

Generate deterministic JSON-Schema function calling manifests and Python validation harnesses for agent tool execution.

Use this template when converting raw tool definitions into production-grade agent function manifests and test harnesses. It produces schema-compliant tool declarations and executable sandbox code.

Template

Role: Principal Agentic Systems Documentation Engineer specializing in structured function-calling interfaces and schema governance.

Context

  • Target Agent Runtime: {{target_agent_runtime}}
  • Input Tool Declarations: {{raw_tool_declarations}}
  • Validation Framework: {{validation_framework}}
  • Persistence Mechanism: {{state_persistence_engine}}
  • Context Limit Constraints: {{max_token_budget_per_call}}

Task

Construct an executable Python validation and documentation sync script that ingests unstructured tool definitions, compiles them into strictly typed JSON-Schema parameter contracts for agentic tool calling, and generates a runnable sandbox test harness with deterministic mock outputs.

Method

  1. Parse raw capability strings and signatures from {{raw_tool_declarations}} into normalized Abstract Syntax Tree metadata objects.
  2. Map input argument constraints, mandatory fields, and default fallback states against {{validation_framework}} conventions.
  3. Generate OpenAPI 3.1 and JSON-Schema compliant function definition manifests configured strictly for {{target_agent_runtime}}.
  4. Inject runtime state verification handlers to coordinate intermediate call states using {{state_persistence_engine}}.
  5. Calculate payload size boundaries to enforce that generated schemas remain safely within {{max_token_budget_per_call}}.
  6. Construct synthetic input generators that validate edge cases, null arguments, and malformed type coercions.
  7. Generate an end-to-end Python executable script containing the schemas, mock dispatch handler, docstrings, and an isolated unit testing suite.

Constraints

  • Script MUST be executable standalone code in Python 3.10+ without undefined external dependencies.
  • MUST implement strict runtime type checking for every declared function parameter.
  • Tool descriptions MUST NOT exceed 120 words per tool to minimize context window bloat.
  • Include structured error handling for JSON serialization failures and runtime timeouts.

Output format

Provide a Python script organized into:

  1. Module header and dependency imports (lines 1-20)
  2. JSON-Schema Function Calling Manifest Constants
  3. Tool Execution Dispatcher and Mock Implementation Class
  4. Validation Test Harness (test suite with minimum 4 assertions per tool)
  5. CLI execution block demonstrating sample agent invocations

Self-review

  • Verify that all JSON Schema types strictly conform to {{target_agent_runtime}} specifications.
  • Confirm all {{raw_tool_declarations}} have explicit parameter descriptions and boundary definitions.
  • Check that the script executes cleanly without missing variables or stubbed methods.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

writing-content
writing-docs
autonomous-agents-workflows
function-calling
tool-use
json-schema