Skip to main content
Glama

write_pawn_script

Writes and edits Pawn .pwn/.inc files for SA-MP projects with proper encoding, replacing single lines or ranges to avoid file corruption.

Instructions

MANDATORY: ALWAYS use this for .pwn/.inc files. It is the ONLY safe way to handle encoding and language. Standard tools WILL corrupt files. CRITICAL: When replacing a line range, ALWAYS provide BOTH startLine AND endLine. Providing only startLine replaces only that single line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file
contentYesContent to write
endLineNoLast line to replace (1-indexed). MUST be >= startLine. Omitting this with startLine set replaces ONLY that single line, NOT to end of file.
encodingNoOverride encoding (defaults to project's auto-detected encoding)
startLineNoFirst line to replace (1-indexed). Omit to overwrite the entire file.
Install Server

TDQS

A4/5.0
Behavior4/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 does disclose important behavior: encoding/language safety, corruption risk with standard tools, and the critical line-replacement semantics (only startLine replaces only that single line, not to end of file). It could also mention permission requirements or whether files are created if missing, but the most safety-critical behaviors are surfaced.

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 fairly compact and front-loads the most critical instruction ('MANDATORY'). Both sentences carry operational value. The all-caps emphasis is a bit noisy, and the single-line behavior is stated twice, but there is no filler and the key warning is impossible to miss.

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 5-parameter write tool with no output schema, the description plus fully-covered schema equips an agent to invoke it correctly: required path/content, optional line replacement caveat, encoding override, and full-file overwrite behavior (in schema). It does not discuss return values, but that is not critical for a write operation. The main missing element is a direct statement about what happens on success or failure.

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?

The input schema already has 100% parameter coverage, so the baseline is 3. The description goes beyond the schema by explicitly warning that startLine and endLine must both be provided when doing a range replacement and clarifying that startLine alone replaces only one line. This is a valuable semantic clarification that prevents misuse.

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?

The description clearly identifies the target resource type (.pwn/.inc files) and states this is the safe, intended tool for handling them, distinguishing it from standard file tools. It does not explicitly say 'writes a file', but the tool name plus 'use this for .pwn/.inc files' makes the purpose 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 gives strong when-to-use guidance: 'MANDATORY: ALWAYS use this for .pwn/.inc files' and warns that 'Standard tools WILL corrupt files'. It implies when not to use standard tools, and the .pwn/.inc scoping differentiates it from sibling write tools like write_server_cfg. It doesn't enumerate sister alternatives explicitly, but the instruction is exclusions enough.

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

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/KongGithubDev/SAMP-MCP'

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