Skip to main content
Glama
read_markdown.ts788 B
import { z } from "zod"; import { getMarkdownDoc } from "../indexer.js"; import type { ToolDefinition } from "./base.js"; import { createError } from "../util.js"; const schema = z.object({ path: z.string(), }); export const readMarkdownTool: ToolDefinition< typeof schema, { path: string; sha256: string; content: string; } > = { name: "read_markdown", description: "Read a markdown file and return its contents and digest.", schema, execute: async (input) => { const doc = getMarkdownDoc(input.path); if (!doc) { throw createError({ code: "NOT_FOUND", message: `Markdown file not indexed: ${input.path}`, }); } return { path: doc.path, sha256: doc.sha256, content: doc.content, }; }, };

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/ethanolivertroy/fedramp-docs-mcp'

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