Skip to main content
Glama
onsecurity
by onsecurity

get-notifications

Retrieve summarized notifications from OnSecurity with customizable sorting, filtering, and pagination options for clear client understanding.

Instructions

Get all notifications data from OnSecurity from client in a high level summary, only include the summary, not the raw data and be sure to present the data in a way that is easy to understand for the client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoOptional sort parameter (e.g. 'created_at-desc' for newest first)
limitNoOptional limit parameter (e.g. 10 for 10 notifications per page)
pageNoOptional page number to fetch (default: 1)
includesNoOptional related data to include
fieldsNoOptional comma-separated list of fields to return (e.g. 'heading,created_at')
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 main execution logic for the get-notifications tool. It processes input parameters, applies filters, fetches notification data from the OnSecurity API via fetchPage, formats the results using formatNotification and formatPaginationInfo, and returns a structured markdown text response.
    async (params) => {
        const filters: Record<string, string | number> = {};
        
        // Add additional filters if provided
        if (params.filters) {
            Object.entries(params.filters).forEach(([key, value]) => {
                filters[key] = value;
            });
        }
        
        const response = await fetchPage<ApiResponse<NotificationFeature>>(
            'notifications', 
            params.page || 1, 
            filters, 
            params.sort, 
            params.includes, 
            params.fields, 
            params.limit
        );
        
        if (!response) {
            return {
                content: [
                    {
                        type: "text",
                        text: "Error fetching notifications data. Please try again."
                    }
                ]
            };
        }
        
        const paginationInfo = formatPaginationInfo(response);
        const formattedNotifications = response.result.map(formatNotification);
        
        const responseText = [
            "# Notifications Summary",
            "",
            "## Pagination Information",
            paginationInfo,
            "",
            "## Notifications Data",
            ...formattedNotifications
        ].join('\n');
    
        return {
            content: [
                {
                    type: "text",
                    text: responseText
                }
            ]
        };
    }
  • Zod schema defining the input parameters for the get-notifications tool, including pagination, sorting, filtering, and field selection options.
    {
        sort: z.string().optional().describe("Optional sort parameter (e.g. 'created_at-desc' for newest first)"),
        limit: z.number().optional().describe("Optional limit parameter (e.g. 10 for 10 notifications per page)"),
        page: z.number().optional().describe("Optional page number to fetch (default: 1)"),
        includes: z.string().optional().describe("Optional related data to include"),
        fields: z.string().optional().describe("Optional comma-separated list of fields to return (e.g. 'heading,created_at')"),
        filters: FilterSchema,
    },
  • src/index.ts:522-586 (registration)
    The server.tool call that registers the 'get-notifications' tool with the MCP server, including its name, description, input schema, and handler function.
    server.tool(
        "get-notifications",
        "Get all notifications data from OnSecurity from client in a high level summary, only include the summary, not the raw data and be sure to present the data in a way that is easy to understand for the client.",
        {
            sort: z.string().optional().describe("Optional sort parameter (e.g. 'created_at-desc' for newest first)"),
            limit: z.number().optional().describe("Optional limit parameter (e.g. 10 for 10 notifications per page)"),
            page: z.number().optional().describe("Optional page number to fetch (default: 1)"),
            includes: z.string().optional().describe("Optional related data to include"),
            fields: z.string().optional().describe("Optional comma-separated list of fields to return (e.g. 'heading,created_at')"),
            filters: FilterSchema,
        },
        async (params) => {
            const filters: Record<string, string | number> = {};
            
            // Add additional filters if provided
            if (params.filters) {
                Object.entries(params.filters).forEach(([key, value]) => {
                    filters[key] = value;
                });
            }
            
            const response = await fetchPage<ApiResponse<NotificationFeature>>(
                'notifications', 
                params.page || 1, 
                filters, 
                params.sort, 
                params.includes, 
                params.fields, 
                params.limit
            );
            
            if (!response) {
                return {
                    content: [
                        {
                            type: "text",
                            text: "Error fetching notifications data. Please try again."
                        }
                    ]
                };
            }
            
            const paginationInfo = formatPaginationInfo(response);
            const formattedNotifications = response.result.map(formatNotification);
            
            const responseText = [
                "# Notifications Summary",
                "",
                "## Pagination Information",
                paginationInfo,
                "",
                "## Notifications Data",
                ...formattedNotifications
            ].join('\n');
    
            return {
                content: [
                    {
                        type: "text",
                        text: responseText
                    }
                ]
            };
        }
    );
  • Utility function specifically used by the get-notifications handler to format individual notification data into a readable string.
    function formatNotification(notification: NotificationFeature): string {
        return [
            `Content: ${notification.heading}`,
            `Created At: ${notification.created_at}`,
            `Updated At: ${notification.updated_at}`,
            `--------------------------------`,
        ].join('\n');
  • TypeScript interfaces defining the structure of NotificationFeature (single notification) and NotificationResponse (paginated API response), used for type safety in the tool implementation.
    export interface NotificationFeature {
        heading?: string;
        created_at?: string;
        updated_at?: string;
    }
    
    export interface NotificationResponse {
        links: {
            self: string;
            first: string;
            next: string | null;
            previous: string | null;
            last: string;
        };
        limit: number;
        sort: null;
        includes: any[];
        total_results: number;
        total_pages: number;
        page: number;
        result: NotificationFeature[];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool provides 'high level summary, only include the summary, not the raw data' which gives some behavioral context about output format. However, it doesn't disclose important behavioral traits like whether this is a read-only operation, potential rate limits, authentication requirements, or what happens with pagination (implied by 'limit' and 'page' parameters).

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 a single, reasonably concise sentence that front-loads the core purpose. However, it could be more structured by separating the 'what' from the 'how' - currently it mixes functional description ('Get all notifications data') with implementation guidance ('be sure to present the data in a way that is easy to understand').

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?

For a tool with 6 parameters, no annotations, no output schema, and true nested objects in the schema, the description is insufficient. It doesn't explain the relationship between the filtering parameters and the 'high level summary' output, doesn't describe the return format, and provides no guidance on error conditions or limitations. The description focuses on presentation aspects while neglecting operational context.

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 fully documents all 6 parameters. The description adds no additional parameter semantics beyond what's in the schema descriptions. It doesn't explain how parameters interact with the 'high level summary' output or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool 'Get all notifications data from OnSecurity' which provides a clear verb+resource combination, but it doesn't distinguish this tool from its siblings (get-blocks, get-findings, etc.) beyond mentioning 'notifications'. The description adds that it provides 'high level summary' data, which helps differentiate its output format from raw data retrieval tools.

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 its sibling tools (get-blocks, get-findings, get-prerequisites, get-rounds). It mentions presenting data 'in a way that is easy to understand for the client' which implies a presentation-focused use case, but doesn't specify when this summary view is preferable to raw data access or when to choose notifications over other data types.

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