Skip to main content
Glama
ajwann

installed-api

py_source

Retrieve the source code of an installed Python function, class, or module, truncated to a character limit, so agents can inspect actual implementations instead of guessing.

Instructions

Return the source code of an installed Python function/class/module (truncated to max_chars).

Input Schema

NameRequiredDescriptionDefault
targetYes
max_charsNo
project_dirNo
include_projectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It mentions truncation (max_chars) and that the target must be installed, but omits whether the operation is read-only (implied), what happens if the target is not found, and other behavioral traits like error handling or return format.

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?

The description is a single, front-loaded sentence with zero waste. It starts with the core action and includes the truncation note without unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and zero schema description coverage for four parameters, the description is far too sparse. It lacks usage guidance and fails to explain two of the four parameters, leaving significant gaps for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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 only explains max_chars via '(truncated to max_chars)' and indirectly describes 'target' as an installed Python function/class/module, but leaves project_dir and include_project completely unexplained.

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 states a specific verb (Return) and resource (source code) with a clear scope (installed Python function/class/module). It does not explicitly differentiate from siblings like py_inspect, but an agent can infer the distinction without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives such as py_inspect or py_versions. The description only states what it does, leaving the agent to infer usage context.

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