ADR 0054: Deprecate Debug Flag from Tool Input Schemas¶
Status: Accepted
Date: 2025-12-27
Deciders: Development Team
Related ADRs: adr0036
Issue: #57
Context¶
The debug flag is duplicated across 4 tool input schemas:
- catalog_search
- broad_chunks_search
- chunks_search
- concept_search
This creates several problems:
- Schema Noise: LLM agents see the
debugparameter in every tool's schema, adding cognitive overhead when parsing tool definitions - Per-Call Decision: Agents must decide whether to pass
debugon each call - Duplication: The same parameter defined in 4 places
- Underutilized Configuration: A centralized
LoggingConfig.debugSearchalready exists (viaDEBUG_SEARCHenv var) but is not used by tools
Decision¶
Remove the debug parameter from all tool input schemas and use the existing Configuration.getInstance().logging.debugSearch setting instead.
Changes¶
-
Remove from params interfaces:
-
Remove from input schemas:
-
Use configuration in execute methods:
import { Configuration } from '../../application/config/index.js'; async execute(params: ConceptualCatalogSearchParams) { const debugSearch = Configuration.getInstance().logging.debugSearch; const result = await this.service.search({ text: params.text, limit: 10, debug: debugSearch // From config, not params }); } -
Update tool descriptions to mention config-based debug:
Consequences¶
Positive¶
- Cleaner Schemas: Tools have fewer parameters for LLMs to parse
- Single Source of Truth: Debug setting controlled via configuration
- Consistent Behavior: All tools use the same debug setting
- Simpler Agent Logic: LLMs don't need to consider debug on each call
Negative¶
- No Per-Call Override: Cannot enable debug for a single call via tool parameters
- Mitigation: Use
DEBUG_SEARCH=trueenv var for debug sessions - This is acceptable since debug is primarily for development/troubleshooting
Neutral¶
- Service Interface Unchanged: Services still accept
debugparameter; only the tool layer changes - Environment Variable Required: Debug requires setting env var, not just passing parameter
Alternatives Considered¶
1. Keep Debug Parameter, Ignore It¶
Approach: Keep debug in schema but always use config
Pros: No breaking change to schema
Cons: Still clutters schemas; misleading parameter
Decision: Rejected - Defeats the purpose
2. Inject Configuration via Constructor¶
Approach: Pass IConfiguration to tool constructors
Pros: More testable; explicit dependency
Cons: Requires modifying tool instantiation in container
Decision: Rejected for this change - Over-engineering for a simple parameter removal. Can be done in future refactoring.
Affected Files¶
src/tools/operations/conceptual_catalog_search.tssrc/tools/operations/conceptual_broad_chunks_search.tssrc/tools/operations/conceptual_chunks_search.tssrc/tools/operations/concept_search.ts
Related Decisions¶
Notes¶
This is a non-breaking change from the perspective of tool consumers. Tools will continue to work the same way; they simply won't advertise the debug parameter. Debug output is now controlled solely via the DEBUG_SEARCH environment variable.