Skip to main content
Glama

Export PTBuilder script

export_script
Destructive

Writes the generated PTBuilder script for the current topology to a .js or .txt file, so users can run it in Packet Tracer instead of copying code from chat.

Instructions

Write the PTBuilder script for the current topology to a file, for users who prefer a file to copying from chat. Use an absolute path: relative paths resolve against $MCP_TRACER_DIR if set, else the server's working directory (now /app), which MCP clients often set arbitrarily. "~" is the user's home directory. Same validation as generate_script: errors block the export unless force: true. Refuses to replace an existing file unless overwrite: true. The user then copies the whole file into Extensions > Builder Code Editor in a new, empty Packet Tracer workspace and clicks Run.

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": {
      "path": "<path>"
    },
    "name": "export_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile to write, e.g. C:\labs\vlans.js. Only .js or .txt file names are accepted; .js is added when the file name has no extension. Absolute path recommended.
forceNoExport even if validation reports errors.
overwriteNotrue = replace the file if it already exists.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior5/5

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

Annotations flag destructiveHint=true and idempotentHint=false; the description corroborates and enriches this by stating validation errors block the export unless force:true and that it refuses to replace an existing file unless overwrite:true. It also discloses the otherwise invisible path-resolution behavior ($MCP_TRACER_DIR, server cwd /app, ~ expansion), which an agent could not infer from any structured field.

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?

Front-loaded with purpose and then organized as path rules, validation rules, overwrite rules, and post-export workflow. Dense but nearly every clause carries actionable information; the final sentence about Packet Tracer is helpful context rather than filler.

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

Completeness4/5

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

For a mutating file-write tool with no output schema, the description covers path handling, failure modes, overwrite protection, and the user's next step. Only the success return value (e.g., the resolved absolute path or a confirmation) is left unspecified.

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 is 3; the description goes further by explaining how a relative path actually resolves and what ~ means, which the schema only vaguely gestures at with 'Absolute path recommended.' force and overwrite semantics are restated consistently with the schema but add the blocking conditions.

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?

States a specific verb and resource: 'Write the PTBuilder script for the current topology to a file.' The phrase 'for users who prefer a file to copying from chat' implicitly contrasts it with the chat-based sibling generate_script, though it never names that sibling as the alternative.

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?

Gives clear selection context ('for users who prefer a file to copying from chat') and explains the two escape hatches, force and overwrite, with their conditions. It also says what the user does afterward. It stops short of an explicit 'use X instead when Y' routing statement.

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