Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

Consulter les logs système

task_logs

View and filter system logs for monitoring task execution, debugging errors, and tracking activity in the MCP SFTP Orchestrator server.

Instructions

Affiche les logs du système MCP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoFiltrer par niveau de log.
searchNoRechercher dans les messages.
limitNoNombre de logs à afficher.

Implementation Reference

  • server.js:683-701 (registration)
    Registration of the 'task_logs' MCP tool, including title, description, input schema (Zod), and the inline handler function that calls queue.getLogs to retrieve and return system logs.
    server.registerTool(
        "task_logs",
        {
            title: "Consulter les logs système",
            description: "Affiche les logs du système MCP.",
            inputSchema: z.object({
                level: z.enum(['error', 'warn', 'info', 'debug']).optional().describe("Filtrer par niveau de log."),
                search: z.string().optional().describe("Rechercher dans les messages."),
                limit: z.number().optional().default(50).describe("Nombre de logs à afficher.")
            })
        },
        async (params) => {
            const logs = queue.getLogs({
                level: params.level,
                search: params.search
            }).slice(-params.limit);
            return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }] };
        }
    );
  • The getLogs helper function in queue.js, which filters the internal logHistory array by level, search term, or since date, and is directly called by the task_logs handler.
    function getLogs(filter = {}) {
        if (!filter || Object.keys(filter).length === 0) {
            return logHistory;
        }
        
        return logHistory.filter(log => {
            if (filter.level && log.level !== filter.level) return false;
            if (filter.since && new Date(log.timestamp) < new Date(filter.since)) return false;
            if (filter.search && !log.message.toLowerCase().includes(filter.search.toLowerCase())) return false;
            return true;
        });
    }
  • The log utility function that creates and appends log entries to the logHistory array (with max 500 entries), which serves as the data source for the task_logs tool via getLogs.
    function log(level, message) {
        const logEntry = { level, message, timestamp: new Date().toISOString() };
        logHistory.push(logEntry);
        if (logHistory.length > MAX_LOGS) {
            logHistory.shift();
        }
        
        // ✅ N'afficher les logs que si MCP_DEBUG=true
        if (!SILENT_MODE && ['error', 'warn', 'info'].includes(level)) {
            const prefix = {
                error: '[❌ ERROR]',
                warn: '[⚠️  WARN]',
                info: '[ℹ️  INFO]',
                debug: '[🔧 DEBUG]'
            }[level] || `[${level.toUpperCase()}]`;
            
            // ✅ TOUJOURS utiliser stderr (pas stdout)
            console.error(`${prefix} ${new Date().toISOString().split('T')[1].split('.')[0]} - ${message}`);
        }
    }
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 states the tool displays logs but doesn't mention whether this is a read-only operation, if it requires special permissions, how logs are retrieved (e.g., real-time vs. historical), or any rate limits. For a log-viewing tool with zero annotation coverage, this is a significant gap in behavioral context.

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

Conciseness4/5

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

The description is a single, efficient sentence in French that directly states the tool's function. It's appropriately sized and front-loaded with the core purpose. However, it could be more structured by including key details like scope or differentiation.

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 a log-viewing tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the logs contain, their format, how they're sorted, or any limitations. With multiple similar siblings, more context is needed to guide proper tool selection.

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 all three parameters (level, search, limit) well-documented in the schema. The description doesn't add any parameter semantics beyond what the schema provides—it doesn't explain how filtering works, what the search covers, or default behaviors. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Affiche les logs du système MCP' states the tool displays MCP system logs, which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like get_docker_logs, get_pm2_logs, or tail_file, which also appear to handle logs. The purpose is understandable but lacks sibling distinction.

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. With multiple log-related siblings (get_docker_logs, get_pm2_logs, tail_file), there's no indication of what makes this tool unique or when it should be preferred. No exclusions or prerequisites are mentioned.

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/fkom13/mcp-sftp-orchestrator'

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