Skip to main content
Glama
Frontmatter MCP

Frontmatter MCP

by kzmshx

Query

query
Read-only

Run DuckDB SQL on Markdown frontmatter to filter, aggregate, and inspect file metadata by glob pattern without manual parsing.

Instructions

Query frontmatter with DuckDB SQL.

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": {
      "glob": "<glob>",
      "sql": "<sql>"
    },
    "name": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL query string. Reference 'files' table. Columns are frontmatter properties plus 'path'. Values are strings; arrays are JSON strings (use from_json(tags, '["VARCHAR"]')).
globYesGlob pattern relative to base directory (e.g. "atoms/**/*.md").

Output Schema

NameRequiredDescriptionDefault
columnsYes
resultsYes
warningsNo
row_countYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.7.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / glob / description
      Added value: +"Glob pattern relative to base directory (e.g. \"atoms/**/*.md\")."
    • addedInput schema / properties / sql / description
      Added value: +"SQL query string. Reference 'files' table. Columns are frontmatter\nproperties plus 'path'. Values are strings; arrays are JSON strings\n(use from_json(tags, '[\"VARCHAR\"]'))."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "columns": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "results": {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "row_count": {
      +    "type": "integer"
      +  },
      +  "warnings": {
      +    "items": {
      +      "description": "A file that was skipped or only partly used, and why.",
      +      "properties": {
      +        "error": {
      +          "type": "string"
      +        },
      +        "path": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "path",
      +        "error"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "results",
      +  "row_count",
      +  "columns"
      +]
  2. First observedv0.5.3

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered, but the description adds nothing beyond restating the mechanism — no note on scope of the scan, cost of broad globs, or whether results are truncated. With annotations present the bar is lower, yet zero added behavioral context keeps this at a 2.

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?

A single front-loaded sentence with no filler, which is efficient. It is arguably sized too small for a SQL-dialect tool, which keeps it from a 5.

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?

An output schema exists and the input schema is fully documented, so most agent needs are met by structured fields. However, the description omits routing guidance versus query_inspect and any hint about result size or glob cost, leaving clear gaps for a tool of moderate complexity.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema itself carries the critical semantics (the 'files' table, string-typed values, from_json for array columns, glob relative to base directory). The description adds no parameter meaning beyond that, so the baseline 3 applies.

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?

States a specific verb (Query) plus the resource (frontmatter) and the mechanism (DuckDB SQL), which is enough for an agent to know exactly what this does. It does not differentiate itself from the sibling query_inspect, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites, and no mention of the sibling query_inspect, which appears to be the closely related alternative. The agent must infer the choice from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.