Skip to main content
Glama

get_my_audit_logs

Retrieve your audit logs from the JSON Database Server using JWT authentication. View recent activity records to monitor access and track changes in your account.

Instructions

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

Input Schema

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

Implementation Reference

  • Main execution logic for get_my_audit_logs tool: token validation, permission check, fetch user-specific audit logs, log the access, format and return response.
    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 }) }] }; } }
  • src/index.js:306-316 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    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, applies limit, sorts by time descending.
    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