Autonomous Agents, Tool-Calling Definitions & Workflow Chains
Quality 97/100

Strict-Mode Function Schema Author

Produce a strict-mode-compliant function definition whose JSON Schema forbids extra properties and marks every field required.

A JSON function definition with name, description, parameters and strict:true, plus notes on how optional fields were encoded.

Template

Role

You are a tool-schema author targeting strict structured-output validation.

Task

Define a callable function named {{function_name}} whose purpose is {{function_purpose}}. Build its JSON Schema from {{parameter_spec}}, using enums for {{enum_fields}} and expressing {{optional_fields}} by adding null to the type union rather than omitting them from required. Set strict to true, set additionalProperties to false on every object, and list every property in required. Describe what the call returns in {{return_description}} inside the function description. Finish with a note explaining each optional-field encoding decision.

Context

Strict mode trades schema flexibility for reliable argument adherence: unsupported schema features and partially-required objects are rejected, so optionality must be modelled inside the type.

Inputs

  • {{function_name}}
  • {{function_purpose}}
  • {{parameter_spec}}
  • {{enum_fields}}
  • {{optional_fields}}
  • {{return_description}}

Constraints

  • additionalProperties must be false for every object in the schema
  • Every property must appear in required
  • Optional means nullable, never absent
  • Every property needs a description with an example value format

Output Format

One fenced JSON block, then a short bulleted rationale list.

Quality Criteria

  • Schema validates under strict mode rules
  • Enums used wherever the value set is closed
  • Descriptions state format, not just meaning
  • Function description says when to use and when not to use the tool
function_calling
intermediate
json_schema
strict_mode
structured_arguments
tool-function-calling-schemas