Skip to main content
Glama
us-all

mlflow-mcp-server

by us-all

log-batch

Log multiple metrics, parameters, and tags to an MLflow run in a single batch operation. Streamline experiment tracking by submitting grouped data together.

Instructions

Log a batch of metrics, params, and tags to a run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYes
metricsNo
paramsNo
tagsNo

Implementation Reference

  • Zod schema for log-batch input validation, defining runId (string) and optional arrays of metrics, params, and tags.
    export const logBatchSchema = z.object({
      runId: z.string(),
      metrics: z.array(metricSchema).optional(),
      params: z.array(paramSchema).optional(),
      tags: z.array(tagSchema).optional(),
    });
    
    export async function logBatch(params: z.infer<typeof logBatchSchema>) {
      assertWriteAllowed();
      return mlflowClient.post("/runs/log-batch", {
        run_id: params.runId,
        metrics: params.metrics,
        params: params.params,
        tags: params.tags,
      });
    }
  • Handler function for log-batch that calls mlflowClient.post('/runs/log-batch') with the run ID, metrics, params, and tags.
    export async function logBatch(params: z.infer<typeof logBatchSchema>) {
      assertWriteAllowed();
      return mlflowClient.post("/runs/log-batch", {
        run_id: params.runId,
        metrics: params.metrics,
        params: params.params,
        tags: params.tags,
      });
    }
  • Supporting type schemas used by logBatchSchema: tagSchema, metricSchema, and paramSchema.
    const tagSchema = z.object({ key: z.string(), value: z.string() });
    const metricSchema = z.object({
      key: z.string(),
      value: z.number(),
      timestamp: z.number(),
      step: z.number().optional(),
    });
    const paramSchema = z.object({ key: z.string(), value: z.string() });
  • src/index.ts:162-162 (registration)
    Registration of the 'log-batch' MCP tool with its description, schema, and wrapped handler.
    tool("log-batch", "Log a batch of metrics, params, and tags to a run", logBatchSchema.shape, wrapToolHandler(logBatch));
Behavior2/5

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

With no annotations, the description carries full burden of behavioral disclosure. It only states a basic action without revealing effects like overwriting vs appending, error handling, or performance implications. No contradiction with annotations as none exist.

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

Conciseness3/5

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

The description is concise at one sentence, but its brevity leaves significant gaps. It is front-loaded with the action, yet lacks necessary detail. It earns a 3 for being succinct but incomplete.

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 the input schema (four parameters, nested objects, required fields) and no output schema, the description is insufficient. It does not explain array structures or field requirements, leaving the agent underinformed.

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

Parameters2/5

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

Despite 0% schema coverage, the description merely lists 'metrics, params, and tags' without adding meaning beyond the parameter names. It does not explain required fields or nesting structure, which is crucial for correct invocation.

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?

The description uses a specific verb ('Log'), resource ('batch of metrics, params, and tags'), and destination ('to a run'), making the tool's purpose clear. It implicitly distinguishes from sibling tools like 'log-metric' and 'log-param' by using 'batch'.

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?

No guidance is provided on when to use this tool over alternatives. It does not mention prerequisites, exclusions, or any context that helps an agent decide between logging individually or in batch.

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/us-all/mlflow-mcp-server'

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