Skip to main content
Glama
liufeicc

cc-computer-use

by liufeicc

type_text

Type text into a focused input field or specified UI element, optionally clearing existing content first. Falls back to keyboard injection when direct element input is unavailable.

Instructions

输入文本。若给 ref(文本框/输入区),优先用元素级 set_value(最稳,不受焦点影响);否则/失败时降级为键盘注入(xdotool type)。clear_first=true 先全选删除原内容再输入。建议:先 click(ref) 聚焦目标输入框,再 type_text。键盘注入会回报输入后的活动窗口标题——焦点被别的应用抢走时一眼可见,不必再截图核对。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNo
refNo
textYes
clear_firstNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the two execution modes (set_value vs keyboard injection), the effect of clear_first (select-all delete), and the behavior of reporting the active window title after keyboard injection, which aids verification. It doesn't mention potential failures or edge cases, but for a text-input tool this is reasonably transparent.

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 concise (about three sentences) and front-loaded with the core purpose. The fallback logic, suggestion, and reporting note are each purposeful, with no redundant information. It is well-structured and easy to scan.

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 (4 params, no annotations) and the presence of an output schema, the description covers the key operational details: method selection, clear behavior, focus suggestion, and verification hint. The undocumented 'app' parameter is a minor gap, but overall the description provides enough context for an agent to call the tool correctly.

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 0%, so the description must compensate. It explains ref (triggers set_value) and clear_first (clears existing content), and text is implied. However, the 'app' parameter is not explained, leaving a gap. Since it covers two of four parameters meaningfully but not all, a score of 3 reflects partial compensation.

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 the tool's purpose: '输入文本' (input text). It specifies the primary method (element-level set_value) and the fallback (keyboard injection), which distinguishes it from sibling tools like press_key (key presses) and click (clicking). The verb and resource are explicit, and the behavior is unambiguous.

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?

The description provides explicit usage guidance: it instructs to prefer set_value when a ref is given, otherwise fall back to keyboard injection, and it recommends clicking the target input first. It explains when to use clear_first. While it doesn't explicitly contrast with sibling tools, the internal decision logic and actionable suggestion give clear context for usage.

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