verify_response
Verify LLM-generated code against an ontological software contract to catch hallucinated or unauthorized method/function calls, returning validation status and violations.
Instructions
Verifies LLM-generated code against an ontological software contract to detect hallucinated or unauthorized method/function calls.
Args: response_code: The Python code snippet or markdown text produced by the model. contract_or_file: Either the rendered contract string OR the path to the original Python file. target_symbol: If contract_or_file is a file path, specify the target symbol to extract its contract.
Returns: Dictionary with validation status, count of violations, and list of invalid calls.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"response_code": "<response_code>",
"contract_or_file": "<contract_or_file>"
},
"name": "verify_response"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response_code | Yes | ||
| target_symbol | No | ||
| contract_or_file | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||