Skip to main content
Glama

local_ydb_container_logs

Read-onlyIdempotent

Read recent Docker logs from local-ydb containers to diagnose bootstrap, restart, or readiness failures. Target the static or primary dynamic node and control log tail length.

Instructions

Read recent Docker logs from the configured static or primary dynamic local-ydb container. Use when bootstrap, restart, or readiness checks fail; target selects the container role and lines controls the tail length.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileNoNamed profile from local-ydb.config.json. Defaults to config.defaultProfile.
configPathNoExplicit local-ydb config file path to load for this tool call. Useful when the MCP server should pick up a different config without restart.
targetYesContainer role to read logs from: static node or primary dynamic tenant node.
linesNoNumber of recent log lines to read. Defaults to 200.

Implementation Reference

  • The core handler function `containerLogs` that executes the tool logic. It runs `docker logs` for the targeted container (static or dynamic) with a configurable line count, returning stdout/stderr.
    export async function containerLogs(
      ctx: ToolkitContext,
      options: { target: "static" | "dynamic"; lines?: number }
    ) {
      const container = options.target === "dynamic" ? ctx.profile.dynamicContainer : ctx.profile.staticContainer;
      const lines = options.lines ?? 200;
      const result = await ctx.client.run({
        command: "docker",
        args: ["logs", "--tail", String(lines), container],
        allowFailure: true,
        description: `Read ${options.target} container logs`
      });
      return {
        summary: result.ok ? `Read ${options.target} container logs.` : `Failed to read ${options.target} container logs.`,
        ok: result.ok,
        container,
        command: result.command,
        stdout: result.stdout,
        stderr: result.stderr
      };
    }
  • The `logsSchema` function defines the JSON Schema input schema for the tool: required 'target' (static/dynamic) and optional 'lines' (integer, min 1).
    export function logsSchema(): Tool["inputSchema"] {
      return {
        type: "object",
        required: ["target"],
        properties: {
          profile: profileProperty(),
          configPath: configPathProperty(),
          target: {
            type: "string",
            enum: ["static", "dynamic"],
            description: "Container role to read logs from: static node or primary dynamic tenant node.",
          },
          lines: {
            type: "integer",
            minimum: 1,
            description: "Number of recent log lines to read. Defaults to 200.",
          },
        },
        additionalProperties: false,
      };
    }
  • The `LogsArgs` Zod schema (extends ProfileArgs) that validates parsed arguments: target enum and optional positive integer lines.
    export const LogsArgs = ProfileArgs.extend({
      target: z.enum(["static", "dynamic"]),
      lines: z.number().int().positive().optional(),
    });
  • Registration of the 'local_ydb_container_logs' tool in the registry, mapping name, description, inputSchema (from logsSchema()), and handler (withContext wrapping containerLogs).
    defineTool({
      group: "checks",
      name: "local_ydb_container_logs",
      description:
        "Read recent Docker logs from the configured static or primary dynamic local-ydb container. Use when bootstrap, restart, or readiness checks fail; target selects the container role and lines controls the tail length.",
      inputSchema: logsSchema(),
      annotations: readOnlyAnnotations(),
      handler: withContext(LogsArgs, (context, parsed) =>
        containerLogs(context, parsed),
      ),
    }),
  • The return object shape from containerLogs, including summary, ok flag, container name, command, stdout, and stderr.
    return {
      summary: result.ok ? `Read ${options.target} container logs.` : `Failed to read ${options.target} container logs.`,
      ok: result.ok,
      container,
      command: result.command,
      stdout: result.stdout,
      stderr: result.stderr
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds that it reads recent logs and tail length control, which is consistent and provides additional context beyond annotations.

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?

Two sentences, front-loaded with purpose, no wasted words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only log retrieval tool with simple parameters and comprehensive annotations, the description is complete enough. It covers purpose, usage context, and parameter roles.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. Description adds meaning by stating that 'target selects container role and lines controls tail length', reinforcing and clarifying parameter roles beyond schema.

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

Purpose5/5

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

Description clearly states it reads Docker logs from static or primary dynamic local-ydb container, providing a specific verb and resource. It distinguishes itself from sibling tools (e.g., bootstrap, restart) by focusing on log retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use when bootstrap, restart, or readiness checks fail', giving clear context for when to invoke. No explicit when-not-to-use or alternatives, but the guidance is clear and actionable.

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/astandrik/local-ydb-toolkit'

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