Overview
Theset_text_content tool updates the text content of a single text node in Figma. This is useful for making targeted text changes to individual elements.
Parameters
The ID of the text node to modify
New text content to set for the node
Response
Returns a success message containing:- The name of the updated node
- The new text content
Example
Use Cases
Update Button Text
Change the label on a button after getting user feedback.Fix Typos
Correct spelling errors in existing text nodes.Dynamic Content Updates
Update placeholder text with real data.Important Notes
Text Node Type
- Only works on TEXT nodes in Figma
- Will fail if the specified node is not a text node
- Preserves all existing text styling (font, size, color, etc.)
Font Loading
- Figma must have the current font loaded
- If the font is not available, the operation may fail
- The plugin automatically attempts to load the font before updating
Text Overflow
- New text may overflow the text box boundaries
- Figma’s auto-layout will adjust if the text node is in an auto-layout frame
- Fixed-size text boxes may clip text that’s too long
Error Handling
Common errors you might encounter:Performance
- Single Update: Near-instantaneous for individual text changes
- Multiple Updates: For updating many nodes, use set_multiple_text_contents instead
- No Progress Tracking: This tool completes immediately without progress updates
Best Practices
- Verify Node Type: Use
get_node_infofirst to confirm the node is a text node - Batch Operations: For multiple updates, use
set_multiple_text_contentsfor better performance - Preserve Formatting: The tool maintains existing character-level formatting within the text
- Check Text Length: Consider the text box size before setting long text strings
Workflow Example
Related Tools
- scan_text_nodes - Find text nodes to update
- set_multiple_text_contents - Update multiple text nodes at once
- create_text - Create new text nodes
- get_node_info - Get information about a text node