Skip to main content
Glama
link0-o

PerfLens MCP Server

by link0-o

plan_automatic_collection

Read-onlyIdempotent

Create a PID-bound collection plan to configure profiling parameters for a process without sampling or attaching. Specify mode, events, call graph, frequency, and duration.

Instructions

Create a short-lived PID-bound collection plan. This does not sample or attach.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes
modeNorecord
eventsNo
call_graphNodwarf
event_sourceNoauto
frequency_hzNo
duration_secondsNo
max_output_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
eventsNo
backendYes
plan_idYes
warningsNo
call_graphNo
expires_atYes
target_pidYes
target_uidYes
target_typeYes
frequency_hzNo
record_eventNo
policy_statusYes
schema_versionNo1.0
target_runtimeNohost
fallback_eventsNo
container_targetNo
duration_secondsYes
fallback_allowedNo
max_output_bytesYes
required_privilegeYes
fallback_record_eventNo
requested_event_sourceNoauto
target_start_time_ticksYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.2
    • addedOutput schema / $defs
      Added value: +{
      +  "ContainerCollectionCgroupBinding": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "identity_sha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Identity Sha256",
      +        "type": "string"
      +      },
      +      "inode": {
      +        "exclusiveMinimum": 0,
      +        "title": "Inode",
      +        "type": "integer"
      +      },
      +      "version": {
      +        "const": "v2",
      +        "default": "v2",
      +        "title": "Version",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "inode",
      +      "identity_sha256"
      +    ],
      +    "title": "ContainerCollectionCgroupBinding",
      +    "type": "object"
      +  },
      +  "ContainerCollectionNamespaceBinding": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "cgroup_namespace_inode": {
      +        "exclusiveMinimum": 0,
      +        "title": "Cgroup Namespace Inode",
      +        "type": "integer"
      +      },
      +      "mount_namespace_inode": {
      +        "exclusiveMinimum": 0,
      +        "title": "Mount Namespace Inode",
      +        "type": "integer"
      +      },
      +      "pid_namespace_inode": {
      +        "exclusiveMinimum": 0,
      +        "title": "Pid Namespace Inode",
      +        "type": "integer"
      +      },
      +      "user_namespace_inode": {
      +        "exclusiveMinimum": 0,
      +        "title": "User Namespace Inode",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "pid_namespace_inode",
      +      "user_namespace_inode",
      +      "mount_namespace_inode",
      +      "cgroup_namespace_inode"
      +    ],
      +    "title": "ContainerCollectionNamespaceBinding",
      +    "type": "object"
      +  },
      +  "ContainerCollectionTargetBinding": {
      +    "additionalProperties": false,
      +    "description": "Privacy-safe Linux identity required to revalidate one Docker target.",
      +    "properties": {
      +      "adapter_recipe_id": {
      +        "enum": [
      +          "local-docker-read-v1",
      +          "local-docker-managed-v1"
      +        ],
      +        "title": "Adapter Recipe Id",
      +        "type": "string"
      +      },
      +      "adapter_sha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Adapter Sha256",
      +        "type": "string"
      +      },
      +      "cgroup": {
      +        "$ref": "#/$defs/ContainerCollectionCgroupBinding"
      +      },
      +      "container_identity_sha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Container Identity Sha256",
      +        "type": "string"
      +      },
      +      "container_pid": {
      +        "exclusiveMinimum": 0,
      +        "title": "Container Pid",
      +        "type": "integer"
      +      },
      +      "executable_name": {
      +        "pattern": "^[^/\\x00]{1,255}$",
      +        "title": "Executable Name",
      +        "type": "string"
      +      },
      +      "host_pid": {
      +        "exclusiveMinimum": 0,
      +        "title": "Host Pid",
      +        "type": "integer"
      +      },
      +      "host_start_time_ticks": {
      +        "exclusiveMinimum": 0,
      +        "title": "Host Start Time Ticks",
      +        "type": "integer"
      +      },
      +      "host_uid": {
      +        "minimum": 0,
      +        "title": "Host Uid",
      +        "type": "integer"
      +      },
      +      "identity_fingerprint": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Identity Fingerprint",
      +        "type": "string"
      +      },
      +      "image_identity_sha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Image Identity Sha256",
      +        "type": "string"
      +      },
      +      "namespace": {
      +        "$ref": "#/$defs/ContainerCollectionNamespaceBinding"
      +      },
      +      "rootful_risk_authorized": {
      +        "default": false,
      +        "title": "Rootful Risk Authorized",
      +        "type": "boolean"
      +      },
      +      "target_content_sha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "title": "Target Content Sha256",
      +        "type": "string"
      +      },
      +      "target_id": {
      +        "pattern": "^container-target-[a-f0-9]{20}$",
      +        "title": "Target Id",
      +        "type": "string"
      +      },
      +      "target_kind": {
      +        "enum": [
      +          "existing_container",
      +          "managed_temporary_container"
      +        ],
      +        "title": "Target Kind",
      +        "type": "string"
      +      },
      +      "uid_mapping": {
      +        "enum": [
      +          "rootless_same_uid",
      +          "rootful_same_uid",
      +          "rootful_cross_uid"
      +        ],
      +        "title": "Uid Mapping",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "target_id",
      +      "target_kind",
      +      "target_content_sha256",
      +      "container_identity_sha256",
      +      "image_identity_sha256",
      +      "identity_fingerprint",
      +      "container_pid",
      +      "host_pid",
      +      "host_uid",
      +      "host_start_time_ticks",
      +      "executable_name",
      +      "namespace",
      +      "cgroup",
      +      "uid_mapping",
      +      "adapter_recipe_id",
      +      "adapter_sha256"
      +    ],
      +    "title": "ContainerCollectionTargetBinding",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / container_target
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/ContainerCollectionTargetBinding"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedOutput schema / properties / target_runtime
      Added value: +{
      +  "default": "host",
      +  "enum": [
      +    "host",
      +    "docker"
      +  ],
      +  "title": "Target Runtime",
      +  "type": "string"
      +}
  2. Changed7 schema fields changedv0.3.0
    • addedInput schema / properties / event_source
      Added value: +{
      +  "default": "auto",
      +  "enum": [
      +    "auto",
      +    "hardware_required",
      +    "software_only"
      +  ],
      +  "title": "Event Source",
      +  "type": "string"
      +}
    • changedInput schema / properties / events / default
      Previous value: -[
      -  "cycles",
      -  "instructions",
      -  "cache-references",
      -  "cache-misses",
      -  "branches",
      -  "branch-misses",
      -  "context-switches",
      -  "cpu-migrations",
      -  "page-faults"
      -]New value: +[
      +  "cycles",
      +  "instructions",
      +  "cache-references",
      +  "cache-misses",
      +  "branches",
      +  "branch-misses"
      +]
    • addedOutput schema / properties / fallback_allowed
      Added value: +{
      +  "default": false,
      +  "title": "Fallback Allowed",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / fallback_events
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Fallback Events",
      +  "type": "array"
      +}
    • addedOutput schema / properties / fallback_record_event
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "cpu-clock",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Fallback Record Event"
      +}
    • addedOutput schema / properties / record_event
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "cycles",
      +        "cpu-clock"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Record Event"
      +}
    • addedOutput schema / properties / requested_event_source
      Added value: +{
      +  "default": "auto",
      +  "enum": [
      +    "auto",
      +    "hardware_required",
      +    "software_only"
      +  ],
      +  "title": "Requested Event Source",
      +  "type": "string"
      +}
  3. Changed1 schema field changedv0.2.0
    • changedInput schema / properties / max_output_bytes / default
      Previous value: -1073741824New value: +268435456
  4. Addedv0.1.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover read-only and idempotent behavior, and the description adds useful context beyond that: the plan is short-lived, PID-bound, and has no sampling/attach side effects. This gives the agent a clear behavioral model without contradicting the 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 short sentences with no filler. The core purpose is front-loaded, and the clarifying non-goal sentence earns its place by preventing misuse.

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

Completeness3/5

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

The output schema and annotations cover safety and return structure, and the description gives a clear enough role for a planning operation. However, with 0% parameter documentation and no explicit pointer to execute_collection_plan, an agent is left without enough guidance for correct invocation in a broader workflow.

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?

Schema description coverage is 0%, so the description must compensate, but it only clarifies that the plan is PID-bound. It does not explain mode, events, call_graph, event_source, frequency_hz, duration_seconds, or max_output_bytes, leaving the agent to infer meaning from parameter names and defaults alone.

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 ('Create') and a specific resource ('short-lived PID-bound collection plan'), and explicitly states what it does not do ('does not sample or attach'). This clearly distinguishes it from execution and collection siblings like execute_collection_plan and collect_profile.

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?

The description makes the scope clear: this tool only creates a plan, not sample or attach. This gives an implicit boundary against execution/collection tools, but it does not explicitly name alternatives or state 'use execute_collection_plan when you are ready to run the plan.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.