## TL;DR

Reading 300 full field definitions blows the context budget before the real work starts. Instead, fetch the field list (names and types only), select the dozen fields the task needs, and pull full definitions for just those. Describe is a menu; order from it, do not eat it whole.

## Error

```text
Context overflow: reading 300 custom field definitions exceeded the context limit.
```

## Steps

1. Call describe but keep only name, type, and label per field (a compact list). Expected: the whole schema fits in a fraction of the context.
2. Identify the fields the task actually needs (the mapping targets, the merge fields). Expected: a short list, usually under 20.
3. Fetch full definitions only for those fields. Expected: complete metadata where it matters.
4. Cache the compact schema in a file the agent can re-read selectively. Expected: later runs skip even the compact fetch.
5. Refresh the cache on a schedule or on schema-change signals, not on every run. Expected: fresh enough without the cost.

## When to use

- Describe output overflows context.
- An agent reads full field metadata for hundreds of fields.
- Schema exploration before a mapping task.

## When not to use

- Export file overflows (different fix).
- Small objects (just read the definitions).

## Tool compatibility

- Salesforce and HubSpot describe/metadata APIs.
- Agent-side schema caching.

## Variant phrasings

### too many field definitions for context

Fetch names first, details selectively.

### describe overflowed

Compact the schema; cache it.

## Why it happens

Full field definitions are verbose (picklist values, help text, permissions). Multiplied by 300 fields, they exceed any context window while the task needs a handful.

## Edge cases

- Picklist values are the bulkiest part; fetch them only for picklist fields you map.
- Cached schemas go stale; version the cache and refresh on change.
- Some tasks genuinely need many fields; then do the work in code, not in context.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_AHMo8x8Z2KKT1Pw2N0NFUg
