Overview
Thescan_text_nodes tool scans all text nodes within a specified Figma node and returns detailed information about each text element. This tool is optimized for large designs with automatic chunking to prevent UI freezing.
Parameters
ID of the node to scan for text nodes
Response
Returns an object containing:success(boolean) - Whether the scan completed successfullytotalNodes(number) - Total number of text nodes foundprocessedNodes(number) - Number of nodes processedchunks(number) - Number of chunks the operation was divided intotextNodes(array) - Array of text node objects with the following properties:id(string) - Node IDname(string) - Node name in Figmacharacters(string) - Text contentbbox(object) - Bounding box with x, y, width, heightstyle(object) - Text styling information (fontFamily, fontSize, fontWeight, etc.)
Chunking Behavior
The tool automatically processes text nodes in chunks to ensure smooth operation:- Chunk Size: Processes 10 nodes at a time
- Progress Updates: Sends real-time progress updates during processing
- Non-Blocking: Prevents Figma UI from freezing during large scans
- Automatic: Chunking is enabled by default for all scans
- Current chunk being processed
- Number of nodes processed so far
- Estimated completion percentage
Example
Use Cases
Text Inventory
Scan a frame to get a complete inventory of all text elements before making bulk updates.Localization Preparation
Identify all text nodes that need translation in a design.Design Audit
Analyze text styles and content patterns across a design.Performance Considerations
- Large Designs: For frames with 500+ text nodes, expect processing time of 5-10 seconds
- Progress Tracking: Monitor progress updates to track scanning status
- Memory Efficient: Chunking ensures memory usage stays reasonable even for large designs
- Network Overhead: Each progress update is sent over WebSocket, so very large designs may have higher network traffic
Best Practices
- Scope Appropriately: Scan specific frames rather than entire pages when possible
- Monitor Progress: Use progress updates to inform users during long scans
- Cache Results: Store scan results if you need to reference them multiple times
- Combine with Filtering: Use the results with array methods to find specific text nodes
Related Tools
- set_text_content - Update a single text node
- set_multiple_text_contents - Update multiple text nodes in batch
- scan_nodes_by_types - Scan for nodes of specific types