Skip to main content
Glama

pt_send_raw

Execute custom JavaScript in Packet Tracer to explore the IPC API or run commands, with optional result waiting via reportResult().

Instructions

Send arbitrary JavaScript to Packet Tracer via bridge. Useful for exploring the IPC API or running custom commands.

If wait_result=True, reportResult() is auto-injected into scope. Just call reportResult(data) in your code — no need to define it. Examples: pt_send_raw("reportResult(getDevices('router'))", wait_result=True) pt_send_raw("addDevice('TestR','2911',500,300)")

Parameters:

  • js_code: JavaScript to execute in PT's Script Engine

  • wait_result: if True, waits for a response via reportResult()

Refused: activity password material (getHashedPassword, getChallengeKeyAsBase64, getChallengeKeyAsInts) and reading the bytes of a .pka/.pkt.

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": {
      "js_code": "<js_code>"
    },
    "name": "pt_send_raw"
  }
}

Input Schema

NameRequiredDescriptionDefault
js_codeYes
wait_resultNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does real work: it explains the reportResult() auto-injection contract, how wait_result changes execution (waits for a response), and explicitly lists refused capabilities (activity password material, reading .pka/.pkt bytes). It does not explain error behavior, timeouts, or what happens when wait_result=False returns immediately.

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?

Front-loaded one-line purpose, then a conditional behavior note, then copy-pasteable examples, then parameters, then the refusal boundary. Slightly repetitive around reportResult() but every section earns its place.

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?

An output schema exists, so return-value explanation is not needed, and the refusal list covers the key safety boundary for an arbitrary-code tool. Remaining gaps are timeout/synchronous-execution behavior and error surfacing, which matter for a bridge call that can block.

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 description coverage is 0%, so the description must compensate, and it does: js_code is described as JavaScript executed in PT's Script Engine and wait_result is tied to the reportResult() response contract. It falls short of noting value types or that js_code is required.

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?

States a specific verb and resource ("Send arbitrary JavaScript to Packet Tracer via bridge") and the word "arbitrary" positions it as the low-level escape hatch relative to the many structured pt_* tools. An agent can tell immediately this is raw command execution, not a modeled operation.

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?

"Useful for exploring the IPC API or running custom commands" gives a positive use context, but there is no when-not-to-use guidance and no instruction to prefer a dedicated sibling tool when one exists. The two examples show invocation, not selection criteria.

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

Deploy Server

Other Tools