Skip to main content
Glama

execute_officejs

Run custom Office.js code inside a live PowerPoint presentation to add shapes, edit text, change colors, or manage slides, returning results from the executed code.

Instructions

Execute arbitrary Office.js code inside the live PowerPoint presentation. The code runs inside PowerPoint.run(async (context) => { ... }) with 'context' available as a variable. Use 'await context.sync()' after loading properties. Return a value to get it back as the tool result. For positioning, all values are in points (1 point = 1/72 inch). Common operations: add shapes, set text, change colors, add/delete slides.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "execute_officejs"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesOffice.js code to execute. Runs inside PowerPoint.run() with 'context' available. Use 'return' to send back a result.
presentationIdNoTarget presentation ID from list_presentations. Optional when only one presentation is connected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden of behavioral disclosure. It usefully states that code runs against the live presentation, how execution is wrapped, that sync is required, and that a return value is sent back, but it does not disclose safety, permissions, reversibility, error behavior, or the destructive potential of arbitrary code execution.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, then adds execution details, return behavior, units, and common operations without wasted wording. Each sentence contributes useful information for an agent writing Office.js code.

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?

For a complex arbitrary-code execution tool with no output schema and no annotations, the description covers the execution environment, sync requirement, return mechanism, and units. It remains incomplete on tool-selection guidance versus specific sibling tools and on safety or destructive-operation disclosure.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds practical meaning for the code parameter by explaining the execution wrapper, the need for await context.sync(), return-value behavior, and point-based units. It does not elaborate on presentationId beyond what the schema already says.

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 states a specific verb and resource: execute arbitrary Office.js code inside a live PowerPoint presentation. It is clearly an escape-hatch tool rather than a focused operation, but it does not explicitly distinguish itself from specific sibling tools such as add_slide or format_shapes.

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

Usage Guidelines2/5

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

The description gives implementation guidance for writing the code, such as using PowerPoint.run, calling await context.sync(), and returning a value. However, it provides no explicit when-to-use or when-not-to-use guidance relative to the many specific sibling tools, and its examples of adding shapes or slides overlap with dedicated tools.

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