code_type
code_type retrieves the full definition of a TypeScript type, interface, or enum by name. Use it to understand a type’s structure without reading the file that declares it.
code_type(name="UserDTO")code_type(name="ApiResponse")code_type(name="OrderStatus")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | required | Type, interface, or enum name |
Output
Section titled “Output”interface UserDTO { id: string; email: string; name: string; role: 'admin' | 'user' | 'guest'; createdAt: Date; metadata?: Record<string, unknown>;}When to use
Section titled “When to use”- Understand the shape of a DTO or response type before writing code
- Debug a type mismatch — see exactly what fields are available
- Check if an interface has optional fields that might cause null errors
- Navigate inherited or extended types
Related
Section titled “Related”To find every place a type is used across the codebase:
code_type_usages(name="UserDTO", usage_kind="all")