[tool_schemas.py] 1185-line file exceeds AGENTS.md ~400 line limit #666

Closed
opened 2026-06-02 23:38:27 +02:00 by sleepy · 0 comments
Owner

File: src/tool_schemas.py (1185 lines)

AGENTS.md rule: "Split files that exceed ~400 lines or contain multiple concerns."

This file is ~3x over the limit. It contains:

  1. OpenAI function tool schema definitions (FUNCTION_TOOL_SCHEMAS) — the bulk of the file, ~800+ lines of JSON schema definitions
  2. Schema-to-ToolBlock converter (function_call_to_tool_block)

Problem

  • Every schema definition is a large inline dict literal, making the file extremely long but mostly data
  • Schema definitions could be loaded from JSON/YAML files or auto-generated
  • The converter logic is mixed with data definitions

Suggested fix

  • Move schema definitions to src/tools/schemas/ as per-domain JSON files or a single structured data file
  • Keep only the converter + loader logic in a small Python module
  • Or at minimum, split into src/tools/_schemas_core.py (bash/python/web/file tools) and src/tools/_schemas_extended.py (email/calendar/management tools)
## File: `src/tool_schemas.py` (1185 lines) AGENTS.md rule: _"Split files that exceed ~400 lines or contain multiple concerns."_ This file is ~3x over the limit. It contains: 1. **OpenAI function tool schema definitions** (`FUNCTION_TOOL_SCHEMAS`) — the bulk of the file, ~800+ lines of JSON schema definitions 2. **Schema-to-ToolBlock converter** (`function_call_to_tool_block`) ### Problem - Every schema definition is a large inline dict literal, making the file extremely long but mostly data - Schema definitions could be loaded from JSON/YAML files or auto-generated - The converter logic is mixed with data definitions ### Suggested fix - Move schema definitions to `src/tools/schemas/` as per-domain JSON files or a single structured data file - Keep only the converter + loader logic in a small Python module - Or at minimum, split into `src/tools/_schemas_core.py` (bash/python/web/file tools) and `src/tools/_schemas_extended.py` (email/calendar/management tools)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/odysseus#666
No description provided.