> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Tool Schema Consistency • AI Agent SDK

> validate_tool_schema_consistency: Validate a list of tools for schema consistency with OpenAI format.

# validate\_tool\_schema\_consistency

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**base**](../modules/base) module.

Validate a list of tools for schema consistency with OpenAI format.

This function ensures all tools in a list can be properly serialized
and have consistent schema structures for use with LLM providers.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: validate_tool_schema_consistency"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def validate_tool_schema_consistency(tools: List[Any], return_schemas: bool) -> Any
```

## Parameters

<ParamField query="tools" type="List[Any]" required={true}>
  List of tool objects to validate
</ParamField>

<ParamField query="return_schemas" type="bool" required={false} default="False">
  If True, return the list of built schemas instead of just a boolean, so callers can reuse them without rebuilding.
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  True if all tools are valid and consistent (or the built schemas list
  when `return_schemas` is True)
</ResponseField>

### Exceptions

<AccordionGroup>
  <Accordion title="ToolValidationError">
    If validation fails
  </Accordion>
</AccordionGroup>

## Uses

* `validate_tool`
* `ToolValidationError`
* `json.dumps`
* `names.add`

## Used By

* [`get_sorted_tool_schemas`](../functions/get_sorted_tool_schemas)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/tools/base.py#L516">
  `praisonaiagents/tools/base.py` at line 516
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Tools Concept" icon="wrench" href="/docs/docs/concepts/tools" />

  <Card title="Create Custom Tools" icon="plus" href="/docs/docs/guides/tools/create-custom-tools" />

  <Card title="Tool Development" icon="code" href="/docs/docs/tutorials/advanced-tool-development" />
</CardGroup>
