Skip to main content
Glama

convert_encoding

Convert file character encoding between formats like UTF-8, EUC-KR, and Shift_JIS. Automatically detects current encoding and rewrites files to target character sets.

Instructions

Converts a file's encoding to a different character set. Reads the file with auto-detected encoding, then rewrites it in the target encoding. Supports: UTF-8, UTF-8-BOM, EUC-KR, Shift_JIS, ISO-8859-1, UTF-16, ASCII, Windows-1252, Big5, GB18030. Example: convert EUC-KR file to UTF-8, or add/remove UTF-8 BOM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to convert
to_encodingYesTarget encoding. Examples: UTF-8, UTF-8-BOM, EUC-KR, Shift_JIS, ISO-8859-1
Behavior3/5

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

With no annotations provided, the description carries the full burden and successfully discloses the auto-detection behavior and rewrite mechanism. However, it omits critical safety details for a destructive file operation: whether the rewrite is atomic, if file metadata (permissions, timestamps) is preserved, error handling when auto-detection fails, and that no backup is created.

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?

Four sentences with zero waste: purpose statement, mechanism explanation, supported formats list, and concrete examples. Information is front-loaded and every sentence earns its place. The supported encodings are presented as a clean list without redundant exposition.

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 moderate complexity and lack of annotations/output schema, the description adequately covers the functional scope by enumerating all supported encodings and explaining the conversion mechanism. Minor gap in not explicitly warning about the destructive nature of the rewrite operation, though 'rewrites' implies modification.

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?

While the schema has 100% description coverage, the description adds significant value by listing all 10 supported encodings (schema only shows 4 examples) and explaining the auto-detection mechanism—effectively justifying the absence of a 'from_encoding' parameter. This contextualizes the parameters beyond the schema's basic definitions.

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 opens with a specific verb ('Converts') and resource ('file's encoding'), clearly distinguishing it from siblings like 'read', 'write', or 'edit' which handle content rather than character set transformation. The mechanism explanation ('auto-detected encoding, then rewrites') further clarifies the unique scope.

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?

Provides concrete usage examples ('convert EUC-KR file to UTF-8, or add/remove UTF-8 BOM') that implicitly guide when to use this tool over generic file manipulation. Lacks explicit 'when not to use' guidance or comparison to specific siblings like 'edit', but the examples effectively signal the intended use case.

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/knewstimek/agent-tool'

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