# apps/api/src/schemas/tool
dir: apps/api/src/schemas/tool

index: apps/api/src/schemas/tool/.pi-map.index.md

## role
Defines Pydantic data validation schemas for tool instance and tool type API operations in the API layer.
## files
- __init__.py | Package initialization file that exposes tool-related schema classes for import convenience. | dep: src.schemas.tool.tool_instance, src.schemas.tool.tool_type
- tool_instance.py | Defines Pydantic request/response schemas for tool instance lifecycle operations (create, create-on-workspace, start). | exp: class:CreateInstanceRequest, class:CreateWorkspaceInstanceRequest, class:StartInstanceRequest | dep: pydantic
- tool_type.py | Defines Pydantic request/response schemas for tool type CRUD operations with conditional validation logic based on definition type (compose/dockerfile/manifest). | exp: class:ToolTypeCreate, class:ToolTypeUpdate, class:ToolTypeResponse, class:ToolTypeValidateRequest | dep: uuid, datetime, pydantic, src.api.tool.tool_types_validation
## arch
Standard Pydantic schema package pattern with type-specific conditional validation using discriminated unions or field validators based on definition type.
## tags
tool, type, request, instance, create, schemas, pydantic, response
## symbols
- CreateInstanceRequest
- CreateWorkspaceInstanceRequest
- StartInstanceRequest
- ToolTypeCreate
- ToolTypeUpdate
- ToolTypeResponse
- ToolTypeValidateRequest
## workflows
- change tool behavior
  read: __init__.py, tool_instance.py, tool_type.py
## dirty
-
