Skip to main content
Glama

get_all_audit_logs

Retrieve all audit logs from the JSON database server for administrative review and monitoring of system activities.

Instructions

Tüm audit logları getirir (Sadece admin)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesJWT token
limitNoGösterilecek log sayısı (varsayılan: 200)

Implementation Reference

  • MCP tool handler for 'get_all_audit_logs': checks admin permissions via token, calls the getAllAuditLogs helper, audits the access, returns logs or permission error.
    case 'get_all_audit_logs': { const { token, limit = 200 } = args; try { const user = checkPermissionWithToken(token, PERMISSIONS.AUDIT_READ_ALL); const logs = await getAllAuditLogs(limit); // Tüm audit log erişimini logla (kritik) await auditLogger.sensitiveDataAccessed(user.userId, user.role, 'all_audit_logs', { limit }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: logs, total: logs.length, requestedBy: { id: user.userId, role: user.role }, warning: 'Bu tüm sistem audit loglarını içerir - Gizli bilgiler içerebilir' }, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message, requiredPermission: PERMISSIONS.AUDIT_READ_ALL, note: 'Tüm audit loglar sadece admin tarafından görüntülenebilir' }) }] }; } }
  • Input schema for get_all_audit_logs tool: requires JWT token, optional limit (default 200).
    inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 200)' } }, required: ['token'] }
  • src/index.js:318-328 (registration)
    Registration of get_all_audit_logs tool in the MCP ListTools response, defining name, description, and input schema.
    name: 'get_all_audit_logs', description: 'Tüm audit logları getirir (Sadece admin)', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 200)' } }, required: ['token'] } },
  • Helper function that reads the audit logs JSON file and returns the most recent 'limit' number of logs in chronological order (oldest first).
    export async function getAllAuditLogs(limit = 200) { try { const auditData = await readAuditLogs(); return auditData.logs .slice(-limit) .reverse(); } catch (error) { console.error('Tüm audit log hatası:', error); return []; } }

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/yusuferenkt/mcp-database'

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