Skip to main content
Glama

safe_tcl

Execute Tcl command templates with auto-escaped arguments to prevent injection and parsing errors from special characters.

Instructions

执行带参数的 Tcl 命令模板,自动用 Tcl list 规则转义参数。

适用场景:命令中含文件路径、端口名、字符串值等可能有特殊字符的输入。 Tcl 的 $[]{}、反斜杠、空格都会被正确转义,防注入且防解析错。

用法示例:

  • safe_tcl("create_project {0} {1} -part {2}", args=["my_proj", "C:/path with space", "xc7a35tcpg236-1"])

  • safe_tcl("read_verilog {0}", args=["C:/files/top with $dollar.v"])

  • safe_tcl("set_property PACKAGE_PIN {0} [get_ports {1}]", args=["W5", "clk"])

template 用 Python format 的 {0} / {1} 占位符,args 中每个元素会被 tcl_quote() 包装成 "..." 并转义所有特殊字符。

Args: template: Tcl 命令模板,用 {0}/{1}/... 表示参数位置。 args: 参数值列表,将被自动转义。 session_id: 目标会话 ID,默认 "default"。 timeout: 命令执行超时秒数,默认 120。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
timeoutNo
templateYes
session_idNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing the escaping mechanism (tcl_quote), placeholder syntax, and default session/timeout values. It misses any mention of error handling or side effects, but the safety-critical behavioral context is well covered.

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 opening summary, use cases, examples, and parameter list. It is slightly verbose with repeated emphasis on escaping, but every element contributes to clarity and 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?

Given the tool's complexity and lack of annotations, the description covers primary use cases, parameter semantics, and security behavior. It does not address error handling or explicitly contrast with run_tcl, but the presence of an output schema reduces the need to describe return values.

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?

Schema coverage is 0%, but the description compensates fully by explaining each parameter: template placeholders, args escaping behavior, session_id default, and timeout default. Concrete examples illustrate usage, adding significant meaning beyond raw schema types.

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 it executes parameterized Tcl command templates with automatic escaping using Tcl list rules, giving specific verb+resource. The examples further clarify its purpose and implicitly differentiate it from raw Tcl execution tools like run_tcl.

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?

It explicitly lists applicable scenarios (commands with file paths, port names, string values containing special characters) and highlights prevention of injection and parse errors. However, it does not explicitly say when NOT to use it or compare it directly with sibling tools like run_tcl.

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/mapleleavessssssss-wq/vivado-mcp'

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