Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

full_text_search

Search and retrieve relevant content from Obsidian vaults stored in iCloud Drive using tokenized queries. Summarize results to quickly find and interact with specific notes.

Instructions

Tokenize the user's query and the search engine tool will return relevant contents. summarized those contents based on the user's query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The core handler function for 'full_text_search' that parses args, builds a flexsearch index from markdown files in the vault, searches for the query, and returns matching content snippets.
    export async function fullTextSearch(args?: Record<string, unknown>) {
      const parsed = FullTextSearchArgsSchema.safeParse(args)
      if (!parsed.success) {
        throw new Error(`Invalid arguments for full_text_search: ${parsed.error}`)
      }
    
      const filePaths = await getAllMarkdownPaths(process.argv.slice(2))
      const documents = await readAllMarkdowns(filePaths)
    
      const index = new flexsearch.Document({
        document: {
          id: 'id',
          store: true,
          index: [
            {
              field: 'title',
              tokenize: 'forward',
              encoder: flexsearch.Charset.LatinBalance
            },
            {
              field: 'content',
              tokenize: 'forward',
              encoder: flexsearch.Charset.LatinBalance
            }
          ]
        }
      })
    
      documents.forEach((file) => {
        index.add(file)
      })
    
      const searchedIds = index.search(parsed.data.query, { limit: 5 })
      const filteredDocuments = documents
        .filter(({ id }) => searchedIds[0].result.includes(id))
        .map((document) => document.content)
      return {
        content: [
          {
            type: 'text',
            text:
              filteredDocuments.length > 0
                ? filteredDocuments.join('\n---\n')
                : 'No matches found'
          }
        ]
      }
    }
  • Zod schema defining the input for full_text_search: a required 'query' string.
    export const FullTextSearchArgsSchema = z.object({
      query: z.string()
    })
  • src/index.ts:158-161 (registration)
    Tool registration in listToolsRequestHandler, specifying name, description from prompt, and input schema.
      name: 'full_text_search',
      description: fullTextSearchDirectoryPrompt(),
      inputSchema: zodToJsonSchema(FullTextSearchArgsSchema) as ToolInput
    }
  • src/index.ts:215-217 (registration)
    Handler dispatch in callToolRequestHandler switch statement that invokes the fullTextSearch function.
    case 'full_text_search': {
      return fullTextSearch(args)
    }
  • Prompt string used in tool description for full_text_search.
    export const fullTextSearchDirectoryPrompt = () =>
      "Tokenize the user's query and the search engine tool will return relevant contents. " +
      "summarized those contents based on the user's query."
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions tokenization, returning relevant contents, and summarization, but lacks details on permissions, rate limits, error handling, or output format. For a search tool with no structured annotations, this leaves significant gaps in understanding how it behaves operationally.

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

Conciseness3/5

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

The description is two sentences and relatively concise, but it's not front-loaded with the core purpose. The first sentence mixes tokenization and returning content, while the second adds summarization. It could be more structured, e.g., by starting with a clear verb like 'Search and summarize content based on a query.' Some redundancy exists ('query' mentioned twice), but it's not overly verbose.

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

Completeness2/5

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

Given the complexity of a search tool with no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what 'relevant contents' refers to (e.g., files, text snippets), how summarization works, or what the return value includes. For a tool that likely involves processing and returning data, more context is needed to be fully usable.

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?

The input schema has 1 parameter ('query') with 0% description coverage, so the schema provides no semantic information. The description adds that the query is 'tokenize[d]' and used to 'return relevant contents' and 'summarized those contents', giving some context beyond the schema's type definition. However, it doesn't specify query syntax, length limits, or examples, leaving room for improvement.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'tokenize[s] the user's query' and 'return[s] relevant contents' with summarization, which provides a vague purpose. It mentions 'search engine tool' but doesn't specify what resource is being searched (e.g., files, directories, content). Compared to siblings like 'read_file' or 'list_directory', it's unclear if this searches across files, metadata, or other data, making it somewhat ambiguous.

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?

No explicit guidance is provided on when to use this tool versus alternatives. The description implies it's for searching and summarizing content, but it doesn't specify scenarios, prerequisites, or exclusions. For example, it doesn't clarify if this should be used instead of 'read_file' for content discovery or how it differs from other file-related tools in the sibling list.

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

Related 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/YanceyOfficial/obsidian-mcp'

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