Skip to main content
Glama

get_figma_images

Export, compress, and upload images from Figma design nodes to generate publicly accessible URLs for design assets.

Instructions

从Figma导出、压缩并上传指定节点的图像,返回可公开访问的图像URL。

此工具自动化处理从Figma提取设计素材的整个流程:
1. 根据提供的 `file_key` 和 `node_ids` 从Figma API获取图像。
2. 可选择导出节点本身或其所有子节点(默认)。
3. 对导出的图像(JPG/PNG)进行压缩以优化文件大小。
4. 将处理后的图像上传到云存储。
5. 返回一个包含成功上传图像的URL列表和失败详情的字典。

**如何从Figma链接中提取参数:**
当用户提供一个Figma链接时,需要从中提取 `file_key` 和 `node_ids`。
例如,对于链接: `https://www.figma.com/design/d5VnH9TP69zb3EyDejwvKs/My-Design?node-id=1348-2218`
- `file_key` 是 `d5VnH9TP69zb3EyDejwvKs` (位于 `design/` 或 `file/` 之后的部分)
- `node_ids` 是 `1348-2218` (位于 `?node-id=` 之后的部分)

Args:
    file_key (str): Figma文件的唯一标识符。从文件URL中 'file/' 或 'design/' 之后的部分提取。
    node_ids (str): 一个或多个逗号分隔的Figma节点ID。从URL的 `?node-id=` 参数中提取。
    format (str): 导出图像的格式。支持 "jpg", "png", "svg", "pdf"。默认为 "png"。
    scale (float): 图像的缩放比例,取值范围在 0.01 到 4 之间。默认为 1.0 (原始尺寸)。
    compression_quality (float): 图像压缩质量,仅对'jpg'和'png'格式有效。取值范围 0.0 (低质量,高压缩) 到 1.0 (高质量,低压缩)。默认为 0.85。
    export_children (bool): 控制导出行为。
        - `True` (默认): 导出指定`node_ids`下所有直接子节点作为独立的图像。这是最常见的用法,适用于需要节点内多个图层(如图标、图片素材)的场景。
        - `False`: 仅导出`node_ids`指定的节点本身,将其作为一个整体图像。当用户明确指定将节点本身导出时使用。

Returns:
    Dict[str, Any]: 一个字典,包含两个键:
        - "successful_uploads": 一个列表,其中每个元素都是一个字典,包含 `node_id`, `file_name`, 和 `url`。
          例如: `[{"node_id": "1:2", "file_name": "icon.png", "url": "https://cdn.example.com/icon.png"}]`
        - "failed_uploads": 一个包含上传失败详情的列表。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYes
node_idsYes
formatNopng
scaleNo
compression_qualityNo
export_childrenNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It details the entire 5-step workflow, explains what gets exported (nodes or children), describes compression behavior, uploads to cloud storage, and specifies the return format with examples. This provides excellent behavioral context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (overview, workflow steps, parameter extraction guide, Args, Returns) and efficiently conveys complex information. While comprehensive, it maintains focus without unnecessary fluff, though the detailed parameter explanations make it somewhat lengthy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, multi-step workflow) and the absence of both annotations and output schema, the description provides exceptional completeness. It covers purpose, usage, detailed parameter semantics, behavioral workflow, and return format with examples, leaving no significant gaps for the agent to understand and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed semantic explanations for all 6 parameters. It explains what each parameter represents, provides extraction guidance for file_key and node_ids, lists supported formats, defines valid ranges for scale and compression_quality, and gives nuanced guidance on export_children behavior with use case examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('导出、压缩并上传') and resources ('指定节点的图像'), detailing a multi-step workflow from Figma extraction to cloud storage. It distinguishes itself by covering the entire automation pipeline, not just basic export functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (automating Figma design material extraction) and includes practical guidance on extracting parameters from Figma links. However, it doesn't mention when NOT to use it or alternative tools, as no sibling tools are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pursue-LLL/figma-structured-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server