Skip to main content
Glama
mcande21

io.github.mcande21/thealgorithms-mcp

by mcande21

get_algorithm

Fetch a specific algorithm implementation from TheAlgorithms repos by specifying its language and file path. Returns details including examples and optional source code.

Instructions

Fetch one algorithm by language + repo-relative path (e.g. path='sorts/merge_sort.py').

Returns {language, path, github_url, description, examples, line_count, source?}. Examples are extracted where the language has an in-file convention (Python doctests, Rust doc-tests), otherwise empty with a note. Set include_source=False for a cheap peek.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
languageNopython
include_sourceNo
Behavior4/5

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

No annotations provided, so the description carries full burden. It explains that examples may be empty with a note if no inline convention exists, and mentions performance trade-off with include_source. However, it does not explicitly state it's read-only or discuss permissions/rate limits.

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 two sentences and relatively concise, though the second sentence is somewhat lengthy. It front-loads the main action and adds relevant detail without fluff.

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 no output schema, the description lists return fields and notes potential emptiness of examples. It covers parameter usage tips and return variability, but could mention valid language values or error conditions for a fetch with missing path.

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 0%, so description must explain parameters. It explains path with example and include_source with usage tip, but the language parameter is only implied via 'by language' and not explicitly described with valid values or format.

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 clearly states the tool fetches one algorithm by language and repo-relative path, with an example path. It distinguishes from sibling tools like list_languages or search_algorithms by focusing on a single fetch operation.

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

Usage Guidelines3/5

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

The description provides a usage tip (set include_source=false for cheap peek) but does not explicitly contrast when to use this tool vs. search_algorithms or list_categories. It implies usage for specific path lookup but lacks exclusion criteria.

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/mcande21/thealgorithms-mcp'

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