Skip to main content
Glama

Search by Tag

search_by_tag
Read-onlyIdempotent

Find all notes with a specific tag, including nested sub-tags and inline hashtags or YAML frontmatter. Returns matching note paths with optional content previews by topic or workflow stage.

Instructions

Find all notes tagged with a specific tag, including nested sub-tags (searching 'project' matches both #project and #project/alpha). Detects tags from both inline #hashtags and YAML frontmatter. Returns matching note paths with optional content previews. Use to collect notes belonging to a topic, area, or workflow stage.

Input Schema

NameRequiredDescriptionDefault
tagYesTag to search for, with or without # prefix (e.g., 'project' or '#project'). Matches nested tags like 'project/alpha'.
maxResultsNoMaximum number of matching notes to return (1-1000, default: 100)
includeContentNoIf true, include the first 200 characters of each matching note as a preview (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.1.1
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv2.0.0
  3. Removedv1.9.0
  4. Addedv1.4.0
  5. Removedv1.5.3
  6. Addedv0.1.6
  7. Removedv0.1.4
  8. Changed7 schema fields changedv0.1.2
    • changedInput schema / properties / includeContent / description
      Previous value: -"If true, include first 200 characters of note content as a preview"New value: +"If true, include the first 200 characters of each matching note as a preview (default: false)"
    • changedInput schema / properties / maxResults / description
      Previous value: -"Maximum number of results"New value: +"Maximum number of matching notes to return (1-1000, default: 100)"
    • addedInput schema / properties / maxResults / maximum
      Added value: +1000
    • addedInput schema / properties / maxResults / minimum
      Added value: +1
    • changedInput schema / properties / maxResults / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / tag / description
      Previous value: -"Tag to search for (with or without # prefix)"New value: +"Tag to search for, with or without # prefix (e.g., 'project' or '#project'). Matches nested tags like 'project/alpha'."
    • addedInput schema / properties / tag / minLength
      Added value: +1
  9. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world behavior, so the safety profile is covered. The description adds real value on top: prefix optionality implied by matching 'project' vs '#project', sub-tag recursion, dual tag sources, and the return shape (paths plus optional previews).

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?

Three sentences, front-loaded with the core matching rule followed by edge-case behavior and then usage intent. No filler and nothing redundant.

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

Completeness4/5

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

With no output schema, the description correctly states it returns matching note paths with optional content previews, and annotations cover safety. Ordering and pagination beyond maxResults are unaddressed, which is a minor gap for a search tool.

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%, including the default for maxResults and the 200-char preview detail, so the schema carries parameter meaning. The description reinforces tag format and nested matching but adds little beyond what the schema already documents; 3 is the baseline.

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?

States a specific verb (find) plus resource (notes tagged with a tag) and goes further by explaining the matching mechanism: nested sub-tags, inline hashtags, and YAML frontmatter. This distinguishes it operationally from full-text search_notes and search_by_frontmatter even without naming them.

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?

'Use to collect notes belonging to a topic, area, or workflow stage' gives an implied usage context, but there is no explicit when-not guidance and no alternatives (e.g., search_by_frontmatter or search_notes) are named for the agent to route between.

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