Skip to main content
Glama

analyze_link_graph

Visualize document connections in markdown projects to understand relationships and validate links using graph formats like mermaid, JSON, or DOT.

Instructions

Visualize connections between documents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
scopeNoFile scope pattern
formatNoOutput formatmermaid

Implementation Reference

  • Core implementation of the analyze_link_graph tool. Parses arguments, calls writersAid.checkLinks to get links, and returns a Mermaid graph or JSON based on format.
    private async analyzeLinkGraph(args: Record<string, unknown>) { const format = (args.format as string) || "mermaid"; const scope = args.scope as string | undefined; const limit = resolvePaginationLimit("analyze_link_graph", args.limit as number | undefined); const links = await this.writersAid.checkLinks({ scope, limit }); if (format === "mermaid") { return { format: "mermaid", graph: "graph TD\n A[Chapter 1] --> B[Chapter 2]\n B --> C[Chapter 3]", }; } return { links, format }; }
  • Tool registration in the handleTool switch statement that dispatches to the analyzeLinkGraph handler.
    case "analyze_link_graph": return this.analyzeLinkGraph(args);
  • MCP tool schema definition including input parameters (project_path, scope, format) for the analyze_link_graph tool.
    { name: "analyze_link_graph", description: "Visualize connections between documents", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, scope: { type: "string", description: "File scope pattern" }, format: { type: "string", enum: ["mermaid", "json", "dot"], description: "Output format", default: "mermaid", }, }, }, },
  • TypeScript interface defining the response structure for the analyze_link_graph tool.
    /** * Response from analyze_link_graph tool */ export interface AnalyzeLinkGraphResponse { graph: LinkGraph; orphaned_files: string[]; broken_links: MarkdownLink[]; format: 'json' | 'mermaid' | 'dot'; visualization?: string; }

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/xiaolai/claude-writers-aid-mcp'

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