Skip to main content
Glama
hackIDLE

FedRAMP Docs MCP Server

by hackIDLE

grep_controls_in_markdown

Search markdown files for FedRAMP security control identifiers to locate compliance documentation and guidance within FedRAMP documentation.

Instructions

Search markdown files for occurrences of a control identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
controlYes
with_enhancementsNo

Implementation Reference

  • The execute handler for the 'grep_controls_in_markdown' tool. It receives input and calls the core grepControlsInMarkdown function with the control and enhancements flag.
    execute: async (input) => {
      const matches = grepControlsInMarkdown(
        input.control,
        input.with_enhancements ?? true,
      );
      return { matches };
    },
  • Zod input schema defining 'control' (string) and 'with_enhancements' (boolean, default true).
    const schema = z.object({
      control: z.string(),
      with_enhancements: z.boolean().default(true),
    });
  • Core helper function that implements the grep logic: searches indexed markdown documents for control occurrences using regex, with optional enhancement matching (e.g., with params).
    export function grepControlsInMarkdown(
      control: string,
      withEnhancements: boolean,
    ): Array<{ path: string; line: number; snippet: string }> {
      const docs = getIndexState().markdownDocs;
      const escaped = escapeStringRegexp(control);
      const controlRegex = withEnhancements
        ? new RegExp(`${escaped}(\\([^)]+\\))?`, "g")
        : new RegExp(`${escaped}(?!\\()`, "g");
    
      const matches: Array<{ path: string; line: number; snippet: string }> = [];
      for (const doc of docs.values()) {
        doc.lines.forEach((line, idx) => {
          if (controlRegex.test(line)) {
            matches.push({
              path: doc.path,
              line: idx + 1,
              snippet: line.trim().slice(0, 240),
            });
          }
          controlRegex.lastIndex = 0;
        });
      }
      return matches;
    }
  • Import of the grepControlsTool for registration.
    import { grepControlsTool } from "./grep_controls_in_markdown.js";
  • Registration of grepControlsTool in the tools array passed to registerToolDefs.
    grepControlsTool,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions searching but doesn't specify if this is a read-only operation, how results are returned (e.g., list of matches, counts), error handling, or performance considerations like rate limits. This leaves significant gaps for a tool with two parameters.

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 a single, direct sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the key action and resource, making it easy to parse quickly.

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 tool has 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error cases, or the role of the boolean parameter, leaving the agent with insufficient information for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter details. The description only implies the 'control' parameter is a search term, but doesn't explain its format or the meaning of 'with_enhancements' (e.g., what enhancements are). It adds minimal value beyond the schema, failing to compensate for the coverage gap.

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

Purpose4/5

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

The description clearly states the action ('Search') and target ('markdown files for occurrences of a control identifier'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_markdown' or 'search_definitions', which might have overlapping functionality, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search_markdown' or 'search_definitions' from the sibling list. It lacks context on prerequisites, such as whether files need to be loaded first, or exclusions, leaving the agent to infer usage scenarios.

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