Skip to main content
Glama
onsecurity
by onsecurity

get-prerequisites

Retrieve security assessment prerequisites for a specific round to identify requirements that must be completed before testing begins.

Instructions

Get all prerequisites data from OnSecurity for a specific round. Prerequisites are requirements that need to be fulfilled before a security assessment can begin.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
round_idYesRequired round ID to filter prerequisites
sortNoOptional sort parameter in format 'field-direction'. Available values: name-asc, name-desc, created_at-asc, created_at-desc, updated_at-asc, updated_at-desc. Default: id-asc
limitNoOptional limit parameter for max results per page (e.g. 15)
pageNoOptional page number to fetch (default: 1)
fieldsNoOptional comma-separated list of fields to return (e.g. 'id,name,status'). Use * as wildcard.
filtersNoOptional additional filters in format {field: value} or {field-operator: value} where operator can be mt (more than), mte (more than equal), lt (less than), lte (less than equal), eq (equals, default)

Implementation Reference

  • The handler function for the 'get-prerequisites' tool. It constructs filters with the required round_id, fetches data using fetchPage helper from the 'prerequisites' API endpoint, formats the results using formatPrerequisite and formatPaginationInfo, and returns a markdown-formatted text response.
    async (params) => {
        const filters: Record<string, string | number> = {
            'round_id-eq': params.round_id
        };
        
        // Add additional filters if provided
        if (params.filters) {
            Object.entries(params.filters).forEach(([key, value]) => {
                filters[key] = value;
            });
        }
        
        const response = await fetchPage<ApiResponse<PrerequisiteFeature>>(
            'prerequisites', 
            params.page || 1, 
            filters, 
            params.sort, 
            undefined, // includes not mentioned in the docs
            params.fields, 
            params.limit
        );
        
        if (!response) {
            return {
                content: [
                    {
                        type: "text",
                        text: "Error fetching prerequisites data. Please try again."
                    }
                ]
            };
        }
        
        const paginationInfo = formatPaginationInfo(response);
        const formattedPrerequisites = response.result.map(formatPrerequisite);
        
        const responseText = [
            "# Prerequisites Summary",
            "",
            "## Pagination Information",
            paginationInfo,
            "",
            "## Prerequisites Data",
            ...formattedPrerequisites
        ].join('\n');
    
        return {
            content: [
                {
                    type: "text",
                    text: responseText
                }
            ]
        };
    }
  • Zod schema defining the input parameters for the 'get-prerequisites' tool, including required round_id and optional pagination, sorting, and filtering options.
        round_id: z.number().describe("Required round ID to filter prerequisites"),
        sort: z.string().optional().describe("Optional sort parameter in format 'field-direction'. Available values: name-asc, name-desc, created_at-asc, created_at-desc, updated_at-asc, updated_at-desc. Default: id-asc"),
        limit: z.number().optional().describe("Optional limit parameter for max results per page (e.g. 15)"),
        page: z.number().optional().describe("Optional page number to fetch (default: 1)"),
        fields: z.string().optional().describe("Optional comma-separated list of fields to return (e.g. 'id,name,status'). Use * as wildcard."),
        filters: FilterSchema,
    },
  • src/index.ts:589-655 (registration)
    The registration of the 'get-prerequisites' tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
    server.tool(
        "get-prerequisites",
        "Get all prerequisites data from OnSecurity for a specific round. Prerequisites are requirements that need to be fulfilled before a security assessment can begin.",
        {
            round_id: z.number().describe("Required round ID to filter prerequisites"),
            sort: z.string().optional().describe("Optional sort parameter in format 'field-direction'. Available values: name-asc, name-desc, created_at-asc, created_at-desc, updated_at-asc, updated_at-desc. Default: id-asc"),
            limit: z.number().optional().describe("Optional limit parameter for max results per page (e.g. 15)"),
            page: z.number().optional().describe("Optional page number to fetch (default: 1)"),
            fields: z.string().optional().describe("Optional comma-separated list of fields to return (e.g. 'id,name,status'). Use * as wildcard."),
            filters: FilterSchema,
        },
        async (params) => {
            const filters: Record<string, string | number> = {
                'round_id-eq': params.round_id
            };
            
            // Add additional filters if provided
            if (params.filters) {
                Object.entries(params.filters).forEach(([key, value]) => {
                    filters[key] = value;
                });
            }
            
            const response = await fetchPage<ApiResponse<PrerequisiteFeature>>(
                'prerequisites', 
                params.page || 1, 
                filters, 
                params.sort, 
                undefined, // includes not mentioned in the docs
                params.fields, 
                params.limit
            );
            
            if (!response) {
                return {
                    content: [
                        {
                            type: "text",
                            text: "Error fetching prerequisites data. Please try again."
                        }
                    ]
                };
            }
            
            const paginationInfo = formatPaginationInfo(response);
            const formattedPrerequisites = response.result.map(formatPrerequisite);
            
            const responseText = [
                "# Prerequisites Summary",
                "",
                "## Pagination Information",
                paginationInfo,
                "",
                "## Prerequisites Data",
                ...formattedPrerequisites
            ].join('\n');
    
            return {
                content: [
                    {
                        type: "text",
                        text: responseText
                    }
                ]
            };
        }
    );
  • Helper function to format a single PrerequisiteFeature object into a human-readable string used in the tool's response.
    function formatPrerequisite(prerequisite: PrerequisiteFeature): string {
        return [
            `Prerequisite ID: ${prerequisite.id}`,
            `Round ID: ${prerequisite.round_id}`,
            `Name: ${prerequisite.name || "N/A"}`,
            `Description: ${prerequisite.description || "N/A"}`,
            `Required: ${prerequisite.required !== undefined ? prerequisite.required : "N/A"}`,
            `Status: ${prerequisite.status || "N/A"}`,
            `Created At: ${prerequisite.created_at || "N/A"}`,
            `Updated At: ${prerequisite.updated_at || "N/A"}`,
            `--------------------------------`,
        ].join('\n');
  • TypeScript interface defining the structure of a PrerequisiteFeature from the OnSecurity API, used in typing the API response.
    export interface PrerequisiteFeature {
        id: number;
        round_id: number;
        name?: string;
        description?: string;
        required?: boolean;
        status?: string;
        created_at?: string;
        updated_at?: string;
    }
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 states this is a read operation ('Get'), but doesn't mention authentication needs, rate limits, pagination behavior (beyond what parameters imply), error conditions, or response format. For a tool with 6 parameters and no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences. The first sentence states the core purpose, and the second provides helpful domain context about what prerequisites are. There's no wasted text, though it could be slightly more structured for readability.

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's complexity (6 parameters, nested objects, no output schema, and no annotations), the description is insufficient. It doesn't address authentication, response format, error handling, or practical usage scenarios. The agent would need to infer much from the parameter schema alone, which is inadequate for a tool with this level of functionality.

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 fully documents all 6 parameters. The description adds no parameter-specific information beyond implying round_id is needed for filtering. This meets the baseline of 3 when the schema does the heavy lifting, but doesn't provide additional semantic context like example values or usage patterns.

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 verb ('Get') and resource ('prerequisites data from OnSecurity for a specific round'), and explains what prerequisites are ('requirements that need to be fulfilled before a security assessment can begin'). However, it doesn't explicitly differentiate this tool from its siblings (get-blocks, get-findings, etc.), which all appear to be data retrieval tools for different entities.

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. It doesn't mention sibling tools, nor does it specify prerequisites for use (e.g., authentication requirements, round existence). The only implied context is needing a round_id, but this is covered in the required parameter.

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/onsecurity/onsecurity-mcp-server'

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