Skip to main content
Glama
cloudcwfranck

@cloudcraftwithfranck/govcloud-mcp

oscal_fragment

Generate valid OSCAL SSP fragments for Azure resources. Outputs JSON or XML compatible with eMASS import.

Instructions

Generate valid OSCAL SSP fragment (JSON or XML) for Azure resource configurations. Machine-readable output compatible with eMASS OSCAL import.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceDescriptionYesDescribe the Azure resource or configuration
controlIdsYesControl IDs to generate OSCAL for, e.g. ["SC-28","SC-12"]
formatNoOutput format (default: json)
systemIdNoeMASS system ID (optional)
componentNameNoComponent name (optional)

Implementation Reference

  • Tool definition and input schema for oscal_fragment: defines name, description, and JSON Schema input properties (resourceDescription, controlIds, format, systemId, componentName) with resourceDescription and controlIds required.
    export const oscalFragmentTool = {
      name: 'oscal_fragment',
      description:
        'Generate valid OSCAL SSP fragment (JSON or XML) for Azure resource configurations. Machine-readable output compatible with eMASS OSCAL import.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          resourceDescription: {
            type: 'string',
            description: 'Describe the Azure resource or configuration',
          },
          controlIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Control IDs to generate OSCAL for, e.g. ["SC-28","SC-12"]',
          },
          format: {
            type: 'string',
            enum: ['json', 'xml'],
            description: 'Output format (default: json)',
          },
          systemId: {
            type: 'string',
            description: 'eMASS system ID (optional)',
          },
          componentName: {
            type: 'string',
            description: 'Component name (optional)',
          },
        },
        required: ['resourceDescription', 'controlIds'],
      },
    };
  • Zod validation schema for oscal_fragment: validates resourceDescription (max 500), controlIds (array of strings max 500, min 1, max 20), format (json|xml, default json), and optional systemId/componentName (max 500 each).
    const Schema = z.object({
      resourceDescription: z.string().max(500),
      controlIds: z.array(z.string().max(500)).min(1).max(20),
      format: z.enum(['json', 'xml']).default('json'),
      systemId: z.string().max(500).optional(),
      componentName: z.string().max(500).optional(),
    });
  • The main handler function handleOscalFragment: calls runTool with the tool name, args, schema, and an async function that invokes Anthropic Claude to generate an OSCAL 1.1.2 SSP fragment in JSON or XML format based on resource description, control IDs, and optional system ID/component name. Uses the OSCAL_SYSTEM system prompt and token budget of 4096.
    export async function handleOscalFragment(args: unknown): Promise<string> {
      return runTool('oscal_fragment', args, Schema, async ({ resourceDescription, controlIds, format, systemId, componentName }) => {
        const response = await anthropic.messages.create({
          model: MODEL,
          max_tokens: getTokenBudget('oscal_fragment'),
          system: OSCAL_SYSTEM,
          messages: [
            {
              role: 'user',
              content: `Generate an OSCAL 1.1.2 SSP fragment in ${(format ?? 'json').toUpperCase()} format.
    
    **Resource/Configuration:** ${resourceDescription}
    **Controls to Cover:** ${controlIds.join(', ')}
    ${systemId ? `**eMASS System ID:** ${systemId}` : ''}
    ${componentName ? `**Component Name:** ${componentName}` : ''}
    
    Generate the complete OSCAL fragment with implemented-requirements, by-components, and set-parameters sections.`,
            },
          ],
        });
    
        return response.content[0].type === 'text' ? response.content[0].text : '';
      });
    }
  • OSCAL_SYSTEM system prompt constant: instructs the model to generate valid OSCAL 1.1.2 compliant fragments for eMASS import with specific requirements (implemented-requirements with by-components, set-parameters, proper UUIDs, implementation-status, responsible-roles, etc.).
    const OSCAL_SYSTEM = `${BASE_SYSTEM_PROMPT}
    
    You generate valid OSCAL 1.1.2 compliant fragments for eMASS import. Requirements:
    - Generate valid OSCAL JSON or XML (user specified)
    - Include implemented-requirements with by-components
    - Include set-parameters where the control has configurable parameters
    - Use proper OSCAL UUIDs (use placeholder UUIDs in format: 00000000-0000-4000-8000-NNNNNNNNNNNN)
    - Use "implementation-status": "implemented" or "partial" based on context
    - Include "description" fields with specific technical implementation text
    - Reference the Azure service as the component
    - Include "responsible-roles" mapping to customer/provider
    - OSCAL output must be syntactically valid — it will be imported into eMASS`;
  • src/tools/index.ts:7-7 (registration)
    Import of oscalFragmentTool and handleOscalFragment from the compliance/oscal-fragment module.
    import { oscalFragmentTool, handleOscalFragment } from './compliance/oscal-fragment.js';
  • Registration of oscalFragmentTool in the allTools array for MCP tool listing.
    oscalFragmentTool,
  • Dispatch registration: maps the 'oscal_fragment' name to handleOscalFragment in the tool call switch statement.
    case 'oscal_fragment':        return handleOscalFragment(args);
  • Token budget configuration: oscal_fragment is allocated 4096 max tokens for AI responses.
    oscal_fragment: 4096,
  • Timeout configuration: oscal_fragment has a 45-second (45000ms) timeout.
    oscal_fragment: 45000,
  • Minimum response length requirement: oscal_fragment responses must be at least 200 characters.
    oscal_fragment: 200,
  • Response quality validation specific to oscal_fragment: checks that the output contains valid JSON (starts with { or [) or XML (starts with <) or JSON/XML code blocks, otherwise flags an issue.
    if (tool === 'oscal_fragment') {
      const trimmed = response.trim();
      const hasJson = trimmed.startsWith('{') || trimmed.startsWith('[');
      const hasXml = trimmed.startsWith('<');
      const hasJsonBlock = response.includes('```json');
      const hasXmlBlock = response.includes('```xml');
      if (!hasJson && !hasXml && !hasJsonBlock && !hasXmlBlock) {
        issues.push('OSCAL output must be JSON or XML');
      }
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It states the tool generates output but does not mention if it has side effects, requires authentication, or has rate limits. The description lacks details on what happens during execution.

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 deliver the core purpose without redundancy. The description is front-loaded with the primary action, and every word adds value.

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?

With no output schema and no annotations, the description should cover more behavioral aspects (e.g., return format already in schema, but no info on errors, permissions, or limitations). It provides sufficient context for basic use but lacks completeness for a 5-parameter tool.

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?

Schema description coverage is 100%, so the schema already explains each parameter. The description adds overall context (eMASS compatibility, Azure resources) but does not enhance parameter meanings beyond the schema. Baseline of 3 is appropriate.

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 verb 'Generate', the resource 'valid OSCAL SSP fragment', and the context 'for Azure resource configurations'. It also mentions compatibility with eMASS OSCAL import, distinguishing it from sibling tools like ssp_section or poam_generate.

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

Usage Guidelines3/5

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

The description implies a use case (Azure resource OSCAL fragment generation for eMASS) but does not explicitly say when to use this tool over alternatives like ssp_section or control_narrative. No when-not-to-use or prerequisite information is provided.

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/cloudcwfranck/govcloud-mcp'

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