Skip to main content

Module tool_types

Module tool_types 

Source
Expand description

Shared runtime types for the VT Code tool system.

This module provides types shared between the LLM and tools subsystems, breaking the circular dependency that would otherwise exist between them.

§Overview

The key types here are:

  • CompactStr - stack-allocated string for short tool names
  • EnhancedToolResult - tool result with quality metadata
  • ResultMetadata - quality/confidence scoring for tool results
  • [ToolResultConstants] - tool name constants used across subsystems

Modules§

tool_names
Canonical tool name constants used by both LLM and tools subsystems. These match the values defined in vtcode-config::constants::tools.

Structs§

EnhancedToolResult
Enhanced tool result with metadata
ResultMetadata
Quality metadata for tool results

Enums§

ResultCompleteness
Result completeness level

Constants§

DEFAULT_HASHMAP_CAPACITY
DEFAULT_STRING_CAPACITY
DEFAULT_VEC_CAPACITY
Default capacity hints for common collections
ERROR_DETECTION_PATTERNS
Standard error patterns used for error detection across tools
MAX_CONTEXT_LINES
MAX_FILE_SIZE_FOR_PROCESSING
Common tool operation limits
MAX_LIST_ITEMS_SUMMARY
MAX_OUTPUT_TOKENS
MAX_SEARCH_RESULTS
Context optimization constants following AGENTS.md guidelines
NETWORK_ERROR_PATTERNS
Network-related error patterns for more specific error detection
OVERFLOW_INDICATOR_PREFIX
OVERFLOW_INDICATOR_SUFFIX

Traits§

ResultScorer
Trait for scoring tool results

Functions§

canonical_tool_name
Use direct tool name without alias resolution. Alias resolution is now handled by the tool registry inventory which maintains a mapping of aliases to canonical tool names.
empty_object_schema
Reusable empty JSON object schema {"type": "object"} for tool parameter definitions. Used by tools that accept no parameters or only optional parameters.

Type Aliases§

CompactStr
Compact inline string – stack-allocated for strings up to 24 bytes. Drop-in replacement for String with zero heap allocation for short strings.