Skip to main content
Glama
disnet
by disnet

find_broken_links

Identify broken wikilinks in your note vault to maintain content integrity and fix missing references.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler: resolves vault DB connection, calls LinkExtractor.findBrokenLinks(db), returns JSON with broken_links array and count or error.
    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
        };
      }
  • Core implementation: SQL query to find all broken wikilinks (note_links with NULL target_note_id).
    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`
      );
    }
  • Tool schema definition: name, description, and empty inputSchema (optional vault_id handled in handler).
    {
      name: 'find_broken_links',
      description: 'Find all broken wikilinks (links to non-existent notes)',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },
  • MCP server registration: maps 'find_broken_links' tool calls to LinkHandlers.handleFindBrokenLinks.
    case 'find_broken_links':
      return await this.linkHandlers.handleFindBrokenLinks(
        args as unknown as { vault_id?: string }
      );
  • Input validation rules for find_broken_links tool arguments (optional vault_id).
    find_broken_links: [
      {
        field: 'vault_id',
        required: false,
        type: 'string',
        allowEmpty: false
      }
    ],
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this is a read-only operation, its performance characteristics, error handling, or output format. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any redundant information. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's apparent simplicity (no parameters, likely a read operation) but lack of annotations and output schema, the description is minimally adequate. It explains what the tool does but doesn't provide enough context about behavior or results for confident use. The absence of output schema means the description should ideally hint at return format.

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?

The tool has zero parameters, and schema description coverage is 100% (empty schema). The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's purpose. This meets the baseline expectation for parameterless tools.

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 specific action ('find') and target resource ('all broken wikilinks'), with explicit qualification ('links to non-existent notes'). It distinguishes from siblings like 'get_note_links' (which presumably gets all links) and 'search_by_links' (which likely searches by link patterns).

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 implies usage when needing to identify broken wikilinks, but provides no explicit guidance on when to use this versus alternatives like 'get_note_links' or 'search_by_links', nor any prerequisites or exclusions. The context is clear but lacks comparative direction.

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

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