Skip to main content
Glama

Search ISM controls

search_controls

Search across ISM control labels, titles, statements, and group paths. Use filters for applicability, group, or label prefix.

Instructions

Full-text search across ISM control labels, titles, statements, and group paths. Combine with applicability/group/labelPrefix filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
versionNo
applicabilityNoApplicability marking: NC=Non-classified, OS=OFFICIAL: Sensitive, P=PROTECTED, S=SECRET, TS=TOP SECRET.
groupNo
labelPrefixNo
limitNo
offsetNo
includeStatementNoInclude the control statement in each result.

Implementation Reference

  • src/index.ts:248-293 (registration)
    Registration of the 'search_controls' tool on the MCP server via server.registerTool(). Defines the tool name, title, description, input schema (query, version, applicability, group, labelPrefix, limit, offset, includeStatement), and the handler callback.
    server.registerTool(
      "search_controls",
      {
        title: "Search ISM controls",
        description:
          "Full-text search across ISM control labels, titles, statements, and group paths. Combine with applicability/group/labelPrefix filters.",
        inputSchema: {
          query: z.string().min(1),
          version: z.string().optional(),
          applicability: ApplicabilitySchema.optional(),
          group: z.string().optional(),
          labelPrefix: z.string().optional(),
          limit: z.number().int().min(1).max(500).optional(),
          offset: z.number().int().min(0).optional(),
          includeStatement: z
            .boolean()
            .optional()
            .describe("Include the control statement in each result."),
        },
      },
      async (args) => {
        const v = await resolveVersion(args.version);
        const flat = await loadFlat(v.tag);
        const result = searchControls(flat, {
          query: args.query,
          applicability: args.applicability as Applicability | undefined,
          group: args.group,
          labelPrefix: args.labelPrefix,
          limit: args.limit,
          offset: args.offset,
        });
        const items = result.items.map((c) =>
          args.includeStatement
            ? { ...compactControl(c), statement: c.statement }
            : compactControl(c),
        );
        return txt({
          version: v.id,
          query: args.query,
          total: result.total,
          returned: items.length,
          offset: args.offset ?? 0,
          items,
        });
      },
    );
  • The core searchControls() function that performs full-text, applicability, group, and labelPrefix filtering on the flat control list. Accepts FlatControl[] and SearchOptions, returns SearchResult with total count and paginated items.
    export function searchControls(
      controls: FlatControl[],
      opts: SearchOptions,
    ): SearchResult {
      const q = opts.query?.toLowerCase().trim();
      const groupQ = opts.group?.toLowerCase().trim();
      const labelPrefix = opts.labelPrefix?.toUpperCase().trim();
    
      const filtered = controls.filter((c) => {
        if (opts.applicability && !c.applicability.includes(opts.applicability))
          return false;
        if (groupQ && !c.groupPath.some((g) => g.toLowerCase().includes(groupQ)))
          return false;
        if (labelPrefix && !c.label.toUpperCase().startsWith(labelPrefix))
          return false;
        if (q) {
          const hay =
            `${c.label} ${c.title} ${c.statement} ${c.groupPath.join(" ")}`.toLowerCase();
          if (!hay.includes(q)) return false;
        }
        return true;
      });
    
      const offset = Math.max(0, opts.offset ?? 0);
      const limit = Math.max(1, Math.min(opts.limit ?? 50, 500));
      return {
        total: filtered.length,
        items: filtered.slice(offset, offset + limit),
      };
    }
  • Type definitions for the search function: SearchOptions (query, applicability, group, labelPrefix, limit, offset) and SearchResult (total, items).
    export interface SearchOptions {
      query?: string;
      applicability?: Applicability;
      group?: string; // case-insensitive substring match against any element of groupPath
      labelPrefix?: string; // e.g. "GOV", "AC"
      limit?: number;
      offset?: number;
    }
  • The compactControl helper function used by the handler to produce lightweight control representations (id, label, title, section, applicability) for the search results.
        }
      };
      walk(catalog.groups, []);
      for (const c of catalog.controls ?? []) {
        out.push(toFlat(c, []));
      }
      return out;
    }
  • Import statement for searchControls from ./store.js, which is how the handler file references the core logic.
    import {
      controlToMarkdown,
      diffControls,
      flattenCatalog,
      searchControls,
      summarizeGroups,
      type FlatControl,
    } from "./store.js";
    import {
      APPLICABILITY_LABELS,
      PROFILE_NAMES,
      type Applicability,
      type OscalCatalogDoc,
      type ProfileName,
    } from "./types.js";
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as side effects, authorization needs, or rate limits. It only states the search capability, leaving the agent without awareness of destructive potential (none implied) or other constraints.

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?

Two sentences, each adding unique value: first defines action and scope, second gives filter combinations. No redundant or wasted words. Front-loaded with key information.

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?

With 8 parameters, no output schema, and no annotations, the description is too brief. It omits details about pagination, ordering, default limit, and the structure of results (e.g., list of IDs vs full objects). The agent lacks full context to use the tool effectively.

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 only 25% (2 of 8 parameters have descriptions). The description mentions 'applicability/group/labelPrefix filters' but does not explain other parameters like query, version, limit, offset, or includeStatement beyond their names. The description fails to compensate for the low schema coverage.

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 'Full-text search across ISM control labels, titles, statements, and group paths', specifying the verb (search), resource (ISM controls), and scope (multiple fields). This distinguishes it from sibling tools like get_control (specific control) and list_controls (listing without full-text).

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 advises combining with applicable filters, giving clear usage context. However, it does not explicitly exclude when not to use (e.g., when exact ID is known), but the context is sufficient for typical use.

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/RusticEagle/ism-mcp'

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