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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "get_algorithm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| language | No | python | |
| include_source | No |