Skip to main content
Glama

get_algorithm

Fetch the source code or README for a generative art algorithm from the Logic Lab repository by specifying its manifest-relative path.

Instructions

Return the source text of a Logic Lab .py file or README.md.

This tool is read-only: it reads only .py files and README.md files within
the repository boundary. File creation, editing, deletion, and shell execution
are not available through this server.

Returns a dict with:
- path (str): normalized manifest-relative path
- content (str): file text, possibly truncated
- truncated (bool): true when the file exceeded max_chars
- notice (str | null): truncation message with the current limit and maximum,
  or null when content was not truncated

Raises AccessError when the path escapes the repository root, points to a
non-existent file, or refers to a disallowed file type (not .py or README.md).

Call get_algorithm_summary first to confirm relevance before fetching full
source. Call search_algorithms or get_manifest to discover valid paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesManifest-relative path to a .py or README.md file within the Logic Lab repository (e.g. 'physics/wave/wave.py' or 'fractals/mandelbrot/README.md'). Must be a relative path — absolute paths are rejected. Paths that escape the repository root are rejected. Use search_algorithms or get_manifest to discover valid paths.
max_charsNoMaximum characters of source text to return. Accepts integers in the range 1–20000. Default: 12000. When the file exceeds this limit the response sets truncated=true and includes a notice. Increase this value for large source files, up to the hard limit of 20000.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Despite no annotations, the description fully discloses behavioral traits: it is read-only, only reads .py and README.md files, and explicitly states that file creation, editing, deletion, and shell execution are not available. It also details error conditions and return structure.

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 well-structured and concise: a single sentence for purpose, bullet points for return values, clear error conditions, and usage recommendations. Every sentence adds value without redundancy.

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

Completeness5/5

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

The description is fully complete given the tool's complexity and the presence of an output schema. It covers all aspects: input, output, error handling, usage context, and relationships to sibling tools.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, and the description adds significant value beyond the schema by explaining the 'path' parameter as manifest-relative and describing how to discover valid paths, and for 'max_chars' explaining the range, default, and truncation behavior.

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 explicitly states the tool's purpose: 'Return the source text of a Logic Lab .py file or README.md.' It uses a specific verb and resource, and distinguishes from siblings by mentioning alternatives like get_algorithm_summary, search_algorithms, and get_manifest.

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

Usage Guidelines5/5

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

The description provides clear usage guidelines: it recommends calling get_algorithm_summary first to confirm relevance before fetching full source, and suggests search_algorithms or get_manifest for discovering valid paths. It also indicates when not to use this tool (e.g., for other file types or operations).

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/asamiile/logic-lab'

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