Skip to main content
Glama

create_report

Generate penetration testing reports with CVSS 3.1 scoring, HTML formatting, and secure authentication for documenting security assessments across platforms like iOS, Android, and Web.

Instructions

Create a new report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bearerTokenNoBearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)
titleYesThe title/name of the report
platformNoThe platform for the report (e.g., iOS, Android, Web)
templateIdNoTemplate ID for the report (defaults to 67b1dac12c8d23272ad47cbd if not provided)
testersNoArray of tester IDs (optional, defaults to empty array)

Implementation Reference

  • The main handler function that executes the create_report tool logic: authenticates via bearer token, builds payload with title, platform, templateId, testers, posts to API, and returns success/error response.
    async function createReport(providedToken, reportData) { try { const bearerToken = getBearerToken(providedToken); // Build the report payload with default templateId if not provided const payload = { title: reportData.title || "", platform: reportData.platform || "", templateId: reportData.templateId || "67b1dac12c8d23272ad47cbd", testers: reportData.testers || [] }; const response = await axios.post(REPORTS_ENDPOINT, payload, { headers: { 'Authorization': `Bearer ${bearerToken}`, 'Content-Type': 'application/json', }, timeout: 10000, }); return { content: [ { type: 'text', text: JSON.stringify({ success: true, status: response.status, data: response.data, timestamp: new Date().toISOString(), message: 'Report created successfully', }, null, 2), }, ], }; } catch (error) { if (error instanceof McpError) { throw error; } if (error.response) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, status: error.response.status, error: error.response.data || error.message, timestamp: new Date().toISOString(), }, null, 2), }, ], }; } else if (error.request) { throw new McpError( ErrorCode.InternalError, `Network error: Unable to reach the API at ${REPORTS_ENDPOINT}` ); } else { throw new McpError( ErrorCode.InternalError, `Request setup error: ${error.message}` ); } } }
  • Input schema definition for the create_report tool, including properties for bearerToken, title (required), platform, templateId, testers.
    { name: 'create_report', description: 'Create a new report', inputSchema: { type: 'object', properties: { bearerToken: { type: 'string', description: 'Bearer token for authentication (optional if REPORTS_JWT_TOKEN env var is set)', }, title: { type: 'string', description: 'The title/name of the report', }, platform: { type: 'string', description: 'The platform for the report (e.g., iOS, Android, Web)', }, templateId: { type: 'string', description: 'Template ID for the report (defaults to 67b1dac12c8d23272ad47cbd if not provided)', }, testers: { type: 'array', items: { type: 'string' }, description: 'Array of tester IDs (optional, defaults to empty array)', }, }, required: ['title'], }, },
  • server.js:1131-1144 (registration)
    Registration in the CallToolRequestSchema handler switch statement: validates title presence and maps arguments to call the createReport handler.
    case 'create_report': if (!args.title) { throw new McpError( ErrorCode.InvalidParams, 'Report title is required' ); } return await createReport(args.bearerToken, { title: args.title, platform: args.platform, templateId: args.templateId, testers: args.testers, });
  • Helper utility to obtain bearer token for API calls, prioritizing provided token then environment variable REPORTS_JWT_TOKEN.
    function getBearerToken(providedToken) { // If a token is provided in the request, use it if (providedToken) { return providedToken; } // Otherwise, use the configured JWT token if (JWT_TOKEN) { return JWT_TOKEN; } // If no token is available, throw an error throw new McpError( ErrorCode.InvalidParams, 'No bearer token provided. Either pass bearerToken parameter or set REPORTS_JWT_TOKEN environment variable.' ); }

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

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