Skip to main content
Glama

Execute Local Layout Script in Code Sandbox

canva_execute_layout_script
Destructive

Runs Python or JavaScript in a local sandbox to align, measure, calculate vector coordinates, or batch-process PowerPoint files, saving LLM tokens and returning results with an optional thumbnail preview.

Instructions

Thực thi trực tiếp một kịch bản script (Python hoặc JavaScript) trong môi trường Sandbox cục bộ để thực hiện các thao tác căn chỉnh, đo lường, tính toán tọa độ vector hoặc xử lý hàng loạt trên tệp PowerPoint, tiết kiệm token LLM và trả về kết quả kèm ảnh thumbnail xem trước.

Input Schema

NameRequiredDescriptionDefault
codeYesĐoạn mã kịch bản thực thi trong Sandbox
script_typeNoNgôn ngữ kịch bản thực thi: 'python' (khuyên dùng với python-pptx) hoặc 'javascript'python
slide_numberNoSố thứ tự slide mục tiêu (tùy chọn nếu cần xuất ảnh thumbnail sau khi chạy)
export_thumbnailNoTự động xuất ảnh thumbnail PNG xem trước nếu có chỉ định slide_number
presentation_pathNoĐường dẫn tệp .pptx mục tiêuC:/Users/mrduy/Documents/AI/my_quest/thuyet_trinh/Bao_Cao_Chu_De11.pptx
confirmation_tokenNoMã xác nhận bảo mật khi chạy các thao tác ghi đè hoặc chỉnh sửa hàng loạt

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The annotations already flag this as non-read-only, non-idempotent, and destructive. The description adds that execution happens in a local sandbox and returns results with a preview thumbnail, and the confirmation_token parameter implies that a security gate exists for overwrites. It never states sandbox limits, timeouts, filesystem/network access, or what happens on script errors. For arbitrary code execution, these gaps are material even with annotations present.

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?

One front-loaded sentence leads with the action and the environment, then moves to the use cases and the payoff. It reads as a single run-on sentence with a long clause chain, which slightly hurts scannability, but no sentence is filler.

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

Completeness3/5

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

The tool is a destructive arbitrary-code runner with six parameters and no output schema, so the description carries a heavy burden. It covers the purpose and the thumbnail return, but it omits execution limits, error behavior, and any warning about what the script can touch on disk. That is roughly the minimum an agent needs before calling a sandboxed executor.

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

Parameters3/5

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

Schema description coverage is 100%, so both the code and script_type parameters already document themselves, and the enum for script_type is visible. The description only implies the thumbnail is returned when the slide_number is relevant, but this mapping is present in the schema too. With the schema doing the heavy lifting, baseline 3 applies, and the description adds no syntax or format details beyond it.

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

Purpose4/5

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

The description names a specific verb (execute) and resource (a Python/JavaScript layout script) and enumerates the concrete job types: alignment, measurement, vector coordinate calculation, and batch processing on PowerPoint files. That is far more specific than the sibling tools, which each add one fixed slide type. It stops short of explicitly naming which sibling to prefer for non-script tasks, so it is clear but not fully differentiated.

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

Usage Guidelines3/5

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

The use cases (căn chỉnh, đo lường, tính toán tọa độ vector, xử lý hàng loạt) imply when this tool is appropriate and the 'tiết kiệm token LLM' note hints at why to delegate work to a script instead of many calls. However, there is no explicit 'use this instead of X' or 'do not use for Y' guidance, and no mention of what happens when a purpose-built sibling like canva_add_swot_matrix already exists.

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