Skip to main content
Glama

links

Extract all links from a markdown file including inline, images, wikilinks, autolinks, and reference links. Returns link type, text, target, and line.

Instructions

Extract every link from one markdown file: inline text, images alt (badge constructs yield both image and outer link), [[wikilinks]], , and reference-style [text][id] resolved via their [id]: url definitions. Skips example links inside fenced code blocks. Returns {path, totalLinks, truncated, links:[{type: markdown|image|wikilink|autolink|reference, text, target, line}]} in document order, capped at 200. Map cross-references or collect URLs without reading the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (outside is rejected — call info to see the root). Code: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py; docs: .md .markdown .mdx
Behavior4/5

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

With no annotations, the description carries full burden. It details what is skipped (example links in code blocks), the return structure (path, totalLinks, truncated, links array with type, text, target, line), and limits (capped at 200, document order). It does not cover error handling or permissions, but is thorough for a read-only operation.

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 a single, well-structured paragraph. The first sentence states the main purpose, followed by details on link types, edge cases (badge constructs), and return format. Every sentence adds value, though it could be slightly more concise by grouping similar info.

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 the complexity of link types and no output schema, the description explains the return object structure clearly and lists edge cases (badge constructs, code block skipping). It does not cover all possible errors (e.g., file not found) but is complete enough for typical use.

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

Parameters4/5

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

Schema coverage is 100% and the schema describes the 'path' parameter briefly. The description adds critical semantics: path resolution rules (relative vs absolute), allowed file extensions (code and docs), and a note to use 'info' to see the root. This goes beyond the schema to clarify usage.

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 clearly states the tool extracts every link from a markdown file, enumerating link types (inline, image, wikilinks, autolinks, reference-style). It is specific about the resource and action, but does not explicitly differentiate from sibling tools like 'references' or 'search', which could also involve link extraction.

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 some usage context, such as 'Map cross-references or collect URLs without reading the file,' implying when to use it. However, it does not explicitly state when not to use it or compare to alternatives like 'find' or 'search', leaving the agent to infer.

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/segentic-lab/lens-mcp'

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