Skip to main content
Glama
yusuferenkt

MCP JSON Database Server

by yusuferenkt

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 [];
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving logs but lacks details on permissions required, rate limits, pagination, error handling, or response format. For a read operation with zero annotation coverage, this is insufficient to inform safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Turkish that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every word contributing to understanding the core function.

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?

Given the complexity of audit log retrieval, lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, data scope, or return values, leaving significant gaps for the agent to operate effectively in this 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%, with clear descriptions for both parameters ('token' as JWT token, 'limit' as number of logs with default 50). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high coverage without compensating value.

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

Purpose4/5

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

The description clearly states the action ('getirir' - fetches/retrieves) and the resource ('kendi audit loglarını' - own audit logs), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_all_audit_logs' or 'get_audit_logs_by_category', which would be needed for a perfect score.

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 alternatives like 'get_all_audit_logs' or 'get_audit_logs_by_date'. It simply states what it does without context about appropriate scenarios or exclusions, leaving the agent to infer usage from the name alone.

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

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