Skip to content

notes.read with include: ['stats'] fails with output schema validation error #27

@OliverBokan

Description

@OliverBokan

Description

Calling notes.read with include: ['stats'] returns an MCP output validation error. The headings and links fields in the stats response appear to be objects instead of the numbers the schema expects.

Error

MCP error -32602: Output validation error: Invalid structured content for tool notes.read: [
  {
    "expected": "number",
    "code": "invalid_type",
    "path": ["stats", "headings"],
    "message": "Invalid input: expected number, received object"
  },
  {
    "expected": "number",
    "code": "invalid_type",
    "path": ["stats", "links"],
    "message": "Invalid input: expected number, received object"
  }
]

Steps to reproduce

{
  "path": "any-note.md",
  "include": ["stats"]
}

Expected behavior

notes.read with include: ['stats'] should return numeric counts for headings and links.

Workaround

Use include: ['content'] or include: ['metadata'] instead — these work correctly.

Environment

  • kObsidian: latest (via npx -y kobsidian-mcp)
  • Client: Claude Cowork (Windows)
  • OS: Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions