Skip to main content
Glama

get_function_body

Extract a named function's complete body from .pwn/.inc files, returning only the code with optional doc comments. Avoids reading the entire file for faster, targeted access.

Instructions

Extract the complete body of a function by name from a .pwn/.inc file. Much more efficient than reading the entire file. Returns only the function code with optional doc comments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the .pwn/.inc file
includeDocNoInclude doc comments above the function
functionNameYesName of the function to extract
Install Server

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 behavioral burden. It clearly discloses the read-only extraction behavior and what is returned ('only the function code with optional doc comments'), plus a performance trait. It does not mention failure behavior when the function is absent, but for a straightforward read operation the core behavior is transparent.

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?

Three tightly written sentences, each earning its place: first identifies the operation, second gives the efficiency rationale, third specifies the exact return contents. No filler or redundancy.

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 simple extraction tool with no annotations and no output schema, the description covers purpose, return scope, efficiency benefit, and optional doc comments. The main omission is behavior when the function name is not found, but the overall context is sufficient for an agent to select and invoke it 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 100%, so the input schema already documents all three parameters. The description adds minimal extra semantic value beyond echoing 'by name' and 'doc comments.' Baseline 3 is appropriate because the schema does the heavy lifting.

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 ('Extract') plus resource ('complete body of a function by name from a .pwn/.inc file'), and explicitly differentiates from reading the entire file. This distinguishes it from sibling read tools without ambiguity.

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 phrase 'Much more efficient than reading the entire file' gives clear contextual guidance for when to choose this tool over a full-file read. It does not name alternatives like search_pawn_script or get_snippet, nor provide explicit when-not conditions, so it stops short of a 5.

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