Skip to main content
Glama
hackIDLE

FedRAMP Docs MCP Server

by hackIDLE

search_markdown

Search FedRAMP markdown documentation to find policies, procedures, requirements, and guidance on security controls and compliance topics.

Instructions

Full-text search across FedRAMP markdown documentation and guidance. Use this to find information about policies, procedures, requirements, and guidance. Examples: 'continuous monitoring', 'incident response', 'significant change', 'authorization boundary'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo
offsetNo

Implementation Reference

  • Core implementation of the search logic for markdown documents using Lunr index. Handles query validation, searching, snippet extraction, pagination, and returns structured results with path, line, snippet, and score.
    export function searchMarkdown(
      query: string,
      limit: number,
      offset: number,
    ): MarkdownSearchResult {
      if (!query.trim()) {
        throw createError({
          code: "BAD_REQUEST",
          message: "Query must not be empty.",
        });
      }
    
      const index = getMarkdownIndex();
      let results: lunr.Index.Result[];
      try {
        results = index.search(query);
      } catch {
        results = index.search(query.replace(/[~*:^+-]/g, " "));
      }
    
      const hits: MarkdownSearchHit[] = [];
      for (const result of results) {
        const doc = getMarkdownDoc(result.ref);
        if (!doc) {
          continue;
        }
        const { line, snippet } = findLineAndSnippet(doc, query);
        hits.push({
          path: doc.path,
          line,
          snippet,
          score: result.score,
        });
      }
    
      const total = hits.length;
      const paginated = hits.slice(offset, offset + limit);
      return { total, hits: paginated };
    }
  • Zod input schema for the search_markdown tool: required 'query' string, optional 'limit' (1-100, default 20), optional 'offset' (default 0).
    const schema = z.object({
      query: z.string(),
      limit: z.number().int().min(1).max(100).default(20),
      offset: z.number().int().min(0).default(0),
    });
  • MCP ToolDefinition for 'search_markdown', including name, description, schema reference, and execute handler that delegates to the core searchMarkdown function.
    export const searchMarkdownTool: ToolDefinition<
      typeof schema,
      ReturnType<typeof searchMarkdown>
    > = {
      name: "search_markdown",
      description: "Full-text search across FedRAMP markdown documentation and guidance. Use this to find information about policies, procedures, requirements, and guidance. Examples: 'continuous monitoring', 'incident response', 'significant change', 'authorization boundary'.",
      schema,
      execute: async (input) => {
        return searchMarkdown(input.query, input.limit ?? 20, input.offset ?? 0);
      },
    };
  • Registers the searchMarkdownTool (imported at line 21) among other tools by passing it to registerToolDefs(server, [...]). This connects the tool to the MCP server.
    export function registerTools(server: McpServer): void {
      registerToolDefs(server, [
        // Document discovery
        listFrmrDocumentsTool,
        getFrmrDocumentTool,
        listVersionsTool,
        // KSI tools
        listKsiTool,
        getKsiTool,
        filterByImpactTool,
        getThemeSummaryTool,
        getEvidenceExamplesTool,
        // Control mapping tools
        listControlsTool,
        getControlRequirementsTool,
        analyzeControlCoverageTool,
        // Search & lookup tools
        searchMarkdownTool,
        readMarkdownTool,
        searchDefinitionsTool,
        getRequirementByIdTool,
        // Analysis tools
        diffFrmrTool,
        grepControlsTool,
        significantChangeTool,
        // System tools
        healthCheckTool,
        updateRepositoryTool,
      ]);
  • Helper function used by searchMarkdown to find the specific line number and snippet containing the query match in a markdown document.
    function findLineAndSnippet(
      doc: MarkdownDoc,
      query: string,
    ): { line: number; snippet: string } {
      const regex = new RegExp(escapeStringRegexp(query), "i");
      for (let index = 0; index < doc.lines.length; index += 1) {
        const line = doc.lines[index];
        if (regex.test(line)) {
          const snippet = line.trim();
          return { line: index + 1, snippet };
        }
      }
      return { line: 1, snippet: doc.lines[0]?.slice(0, 200) ?? "" };
    }
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 describes the tool's function but lacks details on behavioral traits such as rate limits, authentication requirements, error handling, or the format of search results. The mention of 'Full-text search' implies a read-only operation, but this is not explicitly stated.

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?

The description is concise and well-structured, with two sentences: the first states the purpose and usage, and the second provides examples. Every sentence adds value without redundancy, making it easy to understand quickly.

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

Completeness3/5

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

Given the tool's complexity (a search function with 3 parameters) and the lack of annotations and output schema, the description is incomplete. It covers the purpose and usage well but misses details on parameters, behavioral traits, and result format, which are essential for effective tool invocation.

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 schema description coverage is 0%, so the description must compensate for undocumented parameters. It does not mention any parameters explicitly, but the examples ('continuous monitoring', etc.) implicitly relate to the 'query' parameter. However, it provides no guidance on 'limit' or 'offset' parameters, leaving gaps in understanding their use.

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?

The description clearly states the tool's purpose with a specific verb ('Full-text search') and resource ('FedRAMP markdown documentation and guidance'), and it distinguishes this from siblings by specifying the search domain. It provides concrete examples of search terms to illustrate its function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('to find information about policies, procedures, requirements, and guidance') and provides examples of search queries. However, it does not mention when not to use it or name specific alternatives among the sibling tools, such as 'search_definitions' or 'grep_controls_in_markdown'.

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

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

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