Skip to main content
Glama

get_my_audit_logs

Retrieve your audit logs from the MCP JSON Database Server using a JWT token and set a limit for the number of logs displayed.

Instructions

Kullanıcının kendi audit loglarını getirir

Input Schema

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

Implementation Reference

  • Main handler for the 'get_my_audit_logs' tool. Verifies user permissions via token, calls getUserAuditLogs helper, logs the access attempt, and returns the user's recent audit logs.
    case 'get_my_audit_logs': { const { token, limit = 50 } = args; try { const user = checkPermissionWithToken(token, PERMISSIONS.AUDIT_READ); const logs = await getUserAuditLogs(user.userId, limit); // Kendi audit log erişimini logla await auditLogger.dataAccessed(user.userId, user.role, 'my_audit_logs', { limit }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: logs, total: logs.length, requestedBy: { id: user.userId, role: user.role }, note: 'Kendi audit loglarınız gösteriliyor' }, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message, requiredPermission: PERMISSIONS.AUDIT_READ }) }] }; } }
  • Tool schema definition including input schema for token and optional limit, registered in the ListTools response.
    name: 'get_my_audit_logs', description: 'Kullanıcının kendi audit loglarını getirir', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 50)' } }, required: ['token'] } },
  • Helper function that reads audit logs from JSON file, filters by specific userId, returns the most recent 'limit' logs in chronological order.
    export async function getUserAuditLogs(userId, limit = 50) { try { const auditData = await readAuditLogs(); return auditData.logs .filter(log => log.userId === userId) .slice(-limit) .reverse(); } catch (error) { console.error('Kullanıcı 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