Skip to main content
Glama

find_broken_links

Identify and resolve broken wikilinks within your note vault, ensuring accurate connections and seamless navigation in Flint Note’s AI-collaborative system.

Instructions

Find all broken wikilinks (links to non-existent notes)

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • The main MCP tool handler for find_broken_links. Resolves vault context, validates optional vault_id argument, calls LinkExtractor.findBrokenLinks, and returns JSON response with broken links list and count.
    handleFindBrokenLinks = async (args?: { vault_id?: string }) => { try { // Validate arguments if (args) { validateToolArgs('find_broken_links', args); } const { hybridSearchManager } = await this.resolveVaultContext(args?.vault_id); const db = await hybridSearchManager.getDatabaseConnection(); const brokenLinks = await LinkExtractor.findBrokenLinks(db); return { content: [ { type: 'text', text: JSON.stringify( { success: true, broken_links: brokenLinks, count: brokenLinks.length }, null, 2 ) } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text', text: JSON.stringify( { success: false, error: errorMessage }, null, 2 ) } ], isError: true }; } };
  • The JSON schema definition for the find_broken_links tool, defining it as optional arguments with no required properties.
    { name: 'find_broken_links', description: 'Find all broken wikilinks (links to non-existent notes)', inputSchema: { type: 'object', properties: {}, required: [] } },
  • Core helper method that executes the SQL query to find all broken wikilinks (note_links where target_note_id is NULL), ordered by source note and line number.
    static async findBrokenLinks(db: DatabaseConnection): Promise<NoteLinkRow[]> { return await db.all<NoteLinkRow>( `SELECT * FROM note_links WHERE target_note_id IS NULL ORDER BY source_note_id, line_number` ); }
  • Validation rules used by validateToolArgs for the find_broken_links tool, specifying optional vault_id string parameter.
    find_broken_links: [ { field: 'vault_id', required: false, type: 'string', allowEmpty: false } ],

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/disnet/flint-note'

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