data-model.md•2.35 kB
# Data Model: Python Debugging MCP Tool
## Entities
### DebugSession
- id: string (UUID)
- status: enum [idle, running, paused, completed, error]
- entry: string (project-relative path)
- args: string[]
- env: map<string,string>
- createdAt: datetime
- updatedAt: datetime
- lastBreakpoint: BreakpointTarget | null
- timings: {
- lastRunMs: number | null
- totalCpuTimeMs: number
}
### BreakpointTarget
- file: string (project-relative path)
- line: integer (1-based)
- hitCount: integer
### VariableSnapshot
- capturedAt: datetime
- frameFile: string
- frameLine: integer
- locals: array<VariableValue>
### VariableValue
- name: string
- type: string
- repr: string (truncated)
- sizeBytes: integer | null
- isTruncated: boolean
- children: array<VariableValue> (bounded depth)
### ExecutionOutcome
- reached: boolean
- completed: boolean
- error: null | {
- type: string
- message: string
- traceback: string (truncated)
}
- durationMs: number
## Relationships
- DebugSession has many BreakpointTarget (active set)
- VariableSnapshot is produced when a BreakpointTarget is hit within a DebugSession
## Validation Rules
### Path Validation
- **File paths**: Must be project-relative (no absolute paths)
- **Security**: Path traversal blocked (no `..` segments allowed)
- **Existence**: File must exist within workspace root
- **Line numbers**: Must be 1-based and within file bounds
### Request Constraints
- **Arguments**:
- Max length: 20 arguments
- Each argument: ≤ 512 chars
- **Environment variables**:
- Keys: ≤ 64 chars
- Values: ≤ 1024 chars
- Max entries: 50 key-value pairs
### Variable Snapshot Limits (Safe Repr)
- **Depth**: Max 2 levels of nesting for containers
- **Collection size**: Max 50 items shown in lists/dicts/sets
- **String length**: Max 256 chars in repr before truncation
- **Truncation flag**: `isTruncated: true` when any limit hit
### Execution Guards
- **Timeout**: 20 seconds per breakpoint operation (DEFAULT_TIMEOUT_SECONDS)
- **Output capture**: 10MB max per session
- **Session limit**: 1000 max concurrent sessions (soft limit)
### Schema Validation (Pydantic v2)
All requests/responses validated using Pydantic models:
- Type coercion disabled (strict mode)
- Extra fields forbidden in requests
- Required fields enforced
- ValidationError raised with detailed field errors