Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

read_multiple_files

Read and analyze multiple files simultaneously within Obsidian iCloud MCP, returning each file's content with its path. Designed for efficient file comparison and analysis, it handles failed reads for individual files without stopping the operation.

Instructions

Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes

Implementation Reference

  • The handler function for 'read_multiple_files' tool. Parses input arguments using the schema, reads contents of multiple files asynchronously, formats each with path and content, joins them with '---' separator, and returns as a single text content block.
    export async function readMultipleFiles(args?: Record<string, unknown>) { const parsed = ReadMultipleFilesArgsSchema.safeParse(args) if (!parsed.success) { throw new Error( `Invalid arguments for read_multiple_files: ${parsed.error}` ) } const results = await Promise.all( parsed.data.paths.map(async (filePath: string) => { const content = await fs.readFile(filePath, 'utf-8') return `${filePath}:\n${content}\n` }) ) return { content: [{ type: 'text', text: results.join('\n---\n') }] } }
  • Zod schema defining input for read_multiple_files: an object with 'paths' array of strings.
    export const ReadMultipleFilesArgsSchema = z.object({ paths: z.array(z.string()) })
  • src/index.ts:106-108 (registration)
    Registration of the 'read_multiple_files' tool in the ListToolsRequestHandler, specifying name, description from prompt, and input schema converted to JSON schema.
    name: 'read_multiple_files', description: readMultipleFilesPrompt(), inputSchema: zodToJsonSchema(ReadMultipleFilesArgsSchema) as ToolInput
  • src/index.ts:175-177 (registration)
    Dispatch in CallToolRequestHandler switch statement that invokes the readMultipleFiles handler when the tool name matches.
    case 'read_multiple_files': { return readMultipleFiles(args) }
  • Prompt string used as the tool description, explaining the purpose and usage of read_multiple_files.
    export const readMultipleFilesPrompt = () => 'Read the contents of multiple files simultaneously. This is more ' + 'efficient than reading files one by one when you need to analyze ' + "or compare multiple files. Each file's content is returned with its " + "path as a reference. Failed reads for individual files won't stop " + 'the entire operation. Only works within allowed directories.'
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