STEP 2 of the LogicStamp MCP workflow. Call this after
logicstamp_refresh_snapshotto see what components are available.
logicstamp_list_bundles lists all available ROOT component bundles in a snapshot. This command must be called after logicstamp_refresh_snapshot to discover what components are available in your codebase.
The command returns bundle descriptors with component names, file paths, bundle paths (for use in logicstamp_read_bundle), and token estimates. You can filter bundles by directory using the folderPrefix parameter.
- This command only lists ROOT components - Components that have their own bundles (entry points)
- Dependencies are NOT listed here - Components imported by root components appear in
bundle.graph.nodes[]of the root that imports them, not as separate root bundles - If a component isn't in this list, it's a dependency. To find it:
- Read bundles that might import it (check
bundle.graph.nodes[]for the dependency contract) - Search source code to find which root component imports it
- Check bundles in the same folder (dependencies are typically co-located)
- Read bundles that might import it (check
Important: You MUST call this before reading bundles - it tells you which bundlePath values to use in logicstamp_read_bundle.
- After creating a snapshot - Discover what components are available
- Exploring a codebase - See all components organized by folder
- Filtering by directory - Use
folderPrefixto focus on specific parts of the codebase - Token budgeting - Check token estimates before loading bundles
- Type:
string - Description: The snapshot ID returned from
logicstamp_refresh_snapshot. This identifies which snapshot to list bundles from.
-
Type:
string -
Description: Filter bundles by folder path. Only bundles from folders whose path starts with this prefix will be returned.
Examples:
"src/components"- Only bundles fromsrc/componentsand subdirectories"src/pages"- Only bundles fromsrc/pagesand subdirectories"src/utils"- Only bundles fromsrc/utilsand subdirectories
Returns a ListBundlesOutput object with:
- Type:
string - Description: The snapshot ID that was queried
- Type:
number - Description: Total number of bundles found (after filtering by
folderPrefixif provided)
-
Type:
BundleDescriptor[] -
Description: Array of bundle descriptors, each containing:
id- Unique bundle identifier (e.g.,"bundle_Button")rootComponent- Component name extracted from the file (e.g.,"Button")filePath- Relative file path from project root (e.g.,"src/components/Button.tsx")folder- Folder path containing this bundle (e.g.,"src/components")bundlePath- Use this inlogicstamp_read_bundle- Relative path tocontext.jsonfile (e.g.,"src/components/context.json")position- Position in the bundle file (e.g.,"1/5"means first of five bundles)bundleHash- Hash identifier for this bundleapproxTokens- Approximate token count for this bundle
{
"name": "logicstamp_list_bundles",
"arguments": {
"snapshotId": "snap_1764033034172_0"
}
}{
"name": "logicstamp_list_bundles",
"arguments": {
"snapshotId": "snap_1764033034172_0",
"folderPrefix": "src/components"
}
}This will only return bundles from src/components and its subdirectories.
{
"snapshotId": "snap_1764033034172_0",
"totalBundles": 45,
"bundles": [
{
"id": "bundle_Button",
"rootComponent": "Button",
"filePath": "src/components/Button.tsx",
"folder": "src/components",
"bundlePath": "src/components/context.json",
"position": "1/20",
"bundleHash": "abc123def456",
"approxTokens": 2500
},
{
"id": "bundle_Card",
"rootComponent": "Card",
"filePath": "src/components/Card.tsx",
"folder": "src/components",
"bundlePath": "src/components/context.json",
"position": "2/20",
"bundleHash": "def456ghi789",
"approxTokens": 3200
},
{
"id": "bundle_HomePage",
"rootComponent": "HomePage",
"filePath": "src/pages/index.tsx",
"folder": "src/pages",
"bundlePath": "src/pages/context.json",
"position": "1/5",
"bundleHash": "ghi789jkl012",
"approxTokens": 8500
}
]
}This is STEP 2 of the LogicStamp MCP workflow:
- ✅ Call
logicstamp_refresh_snapshot- Creates snapshot (STEP 1) - ✅ Call
logicstamp_list_bundles- Lists available bundles (STEP 2 - you are here) - Call
logicstamp_read_bundle- Read specific bundles usingbundlePathfrom this output (STEP 3)
The bundlePath field from each bundle descriptor is what you'll use in logicstamp_read_bundle:
{
"name": "logicstamp_read_bundle",
"arguments": {
"snapshotId": "snap_1764033034172_0",
"bundlePath": "src/components/context.json",
"rootComponent": "Button"
}
}Use folderPrefix to filter by component type:
"src/components"- UI components"src/pages"- Page components"src/utils"- Utility modules"src/hooks"- Custom hooks
Filter by feature directories:
"src/features/auth"- Authentication features"src/features/dashboard"- Dashboard features"src/features/profile"- User profile features
Filter by architectural layer:
"src/components"- Presentation layer"src/services"- Service layer"src/api"- API layer
- Must call after refresh_snapshot: This command requires a valid
snapshotIdfromlogicstamp_refresh_snapshot. - bundlePath is required: The
bundlePathfield from the output is what you use inlogicstamp_read_bundle. - Multiple bundles per file: A single
context.jsonfile can contain multiple bundles. UserootComponentto specify which one you want. - Token estimates: The
approxTokensfield provides a rough estimate. Actual token counts may vary. ⚠️ Only lists ROOT components: If a component isn't in this list, it's a dependency. Read the bundle of the root component that imports it, then checkbundle.graph.nodes[]for the dependency contract.
logicstamp_refresh_snapshot- Create snapshot (STEP 1)logicstamp_read_bundle- Read detailed bundle information (STEP 3)logicstamp_compare_snapshot- Compare snapshots to detect changes
When watch mode (stamp context --watch) is active, this command automatically handles race conditions that can occur when files are being written:
- Initial delay: Adds a small delay before reading files to let watch mode finish writing:
- Regular watch mode: 200ms delay
- Strict watch mode (
--strict-watch): 500ms delay (breaking change detection takes slightly longer)
- Retry logic: If JSON parsing fails (indicating a partially written file), automatically retries up to 3 times with exponential backoff (100ms, 200ms, 400ms)
- Worst case total wait: ~900ms (200ms initial + retries) for regular watch, ~1.1s for strict watch
- Transparent operation: This behavior is automatic and only applies when watch mode is active - no performance impact when watch mode is off
⚠️ Important for AI Assistants: These delays are internal to the MCP tool and handled automatically. Do not usesleep()or other delays before calling this tool - the tool handles all necessary waiting internally. When watch mode is active, bundles are already fresh - just call the tool directly.
This ensures reliable file reading even when watch mode is actively regenerating context files, with minimal user-perceived latency.
If the command fails, it will throw an error with a descriptive message. Common errors:
- Snapshot not found - The
snapshotIddoesn't exist. Make sure you've calledlogicstamp_refresh_snapshotfirst. - Invalid snapshot ID - The
snapshotIdformat is incorrect - Context files missing - The snapshot's context files are missing or corrupted
- File read errors - When watch mode is active, retries are attempted automatically. If all retries fail, the error will indicate the file may still be writing
- MCP Integration Guide - Complete MCP server documentation
- Tool Description - LogicStamp Context capabilities
- Quick Start - Getting started guide