Skip to main content
GitHub

Tool Fixes

Fix tool configuration and behavior.

Tool fixes describe configuration changes for tool calls.

Configuration-Only Fixes

Tool fixes are applied as configuration changes. The fix runtime does not have a built-in tool fix applier -- tool fixes describe the desired configuration change which is applied by the orchestration layer.

Use Cases

  • Add timeouts
  • Validate inputs
  • Transform outputs
  • Add error handling

Configuration

{
  "fix_id": "fix-tool-001",
  "fix_type": "tool",
  "config": {
    "tool_name": "search_api",
    "timeout_ms": 30000,
    "input_validation": {
      "max_query_length": 1000
    }
  }
}

Options

Timeout

{
  "fix_type": "tool",
  "config": {
    "tool_name": "external_api",
    "timeout_ms": 60000
  }
}

Input Validation

{
  "fix_type": "tool",
  "config": {
    "tool_name": "search",
    "input_validation": {
      "required_fields": ["query"],
      "max_field_length": {
        "query": 500
      },
      "allowed_values": {
        "type": ["web", "news", "images"]
      }
    }
  }
}

Output Transformation

{
  "fix_type": "tool",
  "config": {
    "tool_name": "fetch_data",
    "output_transform": {
      "truncate_to": 10000,
      "extract_fields": ["title", "content"],
      "remove_html": true
    }
  }
}

Error Mapping

{
  "fix_type": "tool",
  "config": {
    "tool_name": "api_call",
    "error_mapping": {
      "404": "Resource not found",
      "429": "Rate limited, please retry",
      "500": "Server error, please retry"
    }
  }
}

Common Fixes

Prevent Timeout

{
  "fix_type": "tool",
  "config": {
    "tool_name": "slow_api",
    "timeout_ms": 120000,
    "chunk_large_inputs": true,
    "max_input_size": 50000
  }
}

Fix Invalid Arguments

{
  "fix_type": "tool",
  "config": {
    "tool_name": "search",
    "input_coercion": {
      "query": "string",
      "limit": "integer"
    },
    "default_values": {
      "limit": 10
    }
  }
}

Next Steps