Skip to main content
Glama

p6_query_activities

Read-onlyIdempotent

Search and filter Primavera P6 activities by dates, WBS, status, codes, UDFs, and float, then page through results with selected fields and UDF values.

Instructions

Search activities, one page {total, offset, returned, next_offset, rows} ordered by start (actual, else early) then Activity ID. Dates YYYY-MM-DD (finish_before includes that day). wbs_name_contains matches the name of the activity's own WBS node only (a whole branch: p6_list_wbs or a code filter). Durations and float in days of each activity's calendar. code_type (activity code type name, e.g. 'Discipline'; the project's own type wins over an EPS or global one) keeps activities with a code of that type; code_value narrows it by path ('CON.MEC'), short name ('MEC': every match) or name, with child codes unless include_child_codes=False; code_filter tells what matched. fields= keeps task_code plus the fields named, for smaller pages. udf_filter: UDF conditions (labels as p6_list_udfs shows them), all to hold; a date alone covers the whole day; udf_filter (info) tells what was used. udfs: labels added to each row as udfs {label: value} (None when empty; kept whole in brief rows).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>"
    },
    "name": "p6_query_activities"
  }
}

Input Schema

NameRequiredDescriptionDefault
udfsNoUDF labels (as in P6 columns) to add to each row under 'udfs'.
limitNoRows per page (max 200).
detailNobrief (default): rows without null values; full: every key.brief
fieldsNoFields to return (task_code always first); default all.
offsetNoRows to skip (next_offset of the previous page).
statusNo
projectYesProject ID (p6_list_projects).
code_typeNo
code_valueNo
udf_filterNoUDF conditions, all must hold.
code_prefixNo
start_afterNoYYYY-MM-DD
finish_beforeNoYYYY-MM-DD
name_containsNo
wbs_name_containsNo
include_child_codesNo
max_total_float_daysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed51 schema fields changedv4.2.0
    • removedInput schema / properties / code_prefix / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / code_prefix / default
      Removed value: -null
    • addedInput schema / properties / code_prefix / type
      Added value: +"string"
    • removedInput schema / properties / code_type / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / code_type / default
      Removed value: -null
    • addedInput schema / properties / code_type / type
      Added value: +"string"
    • removedInput schema / properties / code_value / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / code_value / default
      Removed value: -null
    • addedInput schema / properties / code_value / type
      Added value: +"string"
    • changedInput schema / properties / detail / default
      Previous value: -"full"New value: +"brief"
    • changedInput schema / properties / detail / description
      Previous value: -"brief: rows without their null values; full (default): every key."New value: +"brief (default): rows without null values; full: every key."
    • removedInput schema / properties / fields / anyOf
      Removed value: -[
      -  {
      -    "description": "Fields to return (task_code always first); default all.",
      -    "items": {
      -      "enum": [
      -        "task_code",
      -        "task_name",
      -        "status_code",
      -        "task_type",
      -        "wbs_name",
      -        "early_start_date",
      -        "early_end_date",
      -        "late_start_date",
      -        "late_end_date",
      -        "act_start_date",
      -        "act_end_date",
      -        "target_start_date",
      -        "target_end_date",
      -        "cstr_type",
      -        "cstr_label",
      -        "cstr_date",
      -        "phys_complete_pct",
      -        "driving_path_flag",
      -        "orig_dur_d",
      -        "rem_dur_d",
      -        "total_float_d",
      -        "free_float_d",
      -        "float_path",
      -        "float_path_order"
      -      ],
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / fields / default
      Removed value: -null
    • addedInput schema / properties / fields / description
      Added value: +"Fields to return (task_code always first); default all."
    • addedInput schema / properties / fields / items
      Added value: +{
      +  "enum": [
      +    "task_code",
      +    "task_name",
      +    "status_code",
      +    "task_type",
      +    "wbs_name",
      +    "early_start_date",
      +    "early_end_date",
      +    "late_start_date",
      +    "late_end_date",
      +    "act_start_date",
      +    "act_end_date",
      +    "target_start_date",
      +    "target_end_date",
      +    "cstr_type",
      +    "cstr_label",
      +    "cstr_date",
      +    "phys_complete_pct",
      +    "driving_path_flag",
      +    "orig_dur_d",
      +    "rem_dur_d",
      +    "total_float_d",
      +    "free_float_d",
      +    "float_path",
      +    "float_path_order"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / fields / type
      Added value: +"array"
    • removedInput schema / properties / finish_before / anyOf
      Removed value: -[
      -  {
      -    "description": "YYYY-MM-DD",
      -    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / finish_before / default
      Removed value: -null
    • addedInput schema / properties / finish_before / description
      Added value: +"YYYY-MM-DD"
    • addedInput schema / properties / finish_before / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • addedInput schema / properties / finish_before / type
      Added value: +"string"
    • removedInput schema / properties / max_total_float_days / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / max_total_float_days / default
      Removed value: -null
    • addedInput schema / properties / max_total_float_days / type
      Added value: +"number"
    • removedInput schema / properties / name_contains / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / name_contains / default
      Removed value: -null
    • addedInput schema / properties / name_contains / type
      Added value: +"string"
    • changedInput schema / properties / offset / description
      Previous value: -"Rows to skip: pass next_offset from the previous page."New value: +"Rows to skip (next_offset of the previous page)."
    • changedInput schema / properties / project / description
      Previous value: -"Project ID as shown in P6 (p6_list_projects)."New value: +"Project ID (p6_list_projects)."
    • removedInput schema / properties / start_after / anyOf
      Removed value: -[
      -  {
      -    "description": "YYYY-MM-DD",
      -    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / start_after / default
      Removed value: -null
    • addedInput schema / properties / start_after / description
      Added value: +"YYYY-MM-DD"
    • addedInput schema / properties / start_after / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • addedInput schema / properties / start_after / type
      Added value: +"string"
    • removedInput schema / properties / status / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "TK_NotStart",
      -      "TK_Active",
      -      "TK_Complete"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / status / default
      Removed value: -null
    • addedInput schema / properties / status / enum
      Added value: +[
      +  "not_started",
      +  "in_progress",
      +  "completed"
      +]
    • addedInput schema / properties / status / type
      Added value: +"string"
    • removedInput schema / properties / udf_filter / anyOf
      Removed value: -[
      -  {
      -    "description": "UDF conditions, all must hold.",
      -    "items": {
      -      "$ref": "#/$defs/UdfFilter"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / udf_filter / default
      Removed value: -null
    • addedInput schema / properties / udf_filter / description
      Added value: +"UDF conditions, all must hold."
    • addedInput schema / properties / udf_filter / items
      Added value: +{
      +  "$ref": "#/$defs/UdfFilter"
      +}
    • addedInput schema / properties / udf_filter / type
      Added value: +"array"
    • removedInput schema / properties / udfs / anyOf
      Removed value: -[
      -  {
      -    "description": "UDF labels (as in P6 columns) to add to each row under 'udfs'.",
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / udfs / default
      Removed value: -null
    • addedInput schema / properties / udfs / description
      Added value: +"UDF labels (as in P6 columns) to add to each row under 'udfs'."
    • addedInput schema / properties / udfs / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / udfs / type
      Added value: +"array"
    • removedInput schema / properties / wbs_name_contains / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / wbs_name_contains / default
      Removed value: -null
    • addedInput schema / properties / wbs_name_contains / type
      Added value: +"string"
  2. Changed22 schema fields changedv3.5.0
    • removedInput schema / $defs / UdfFilter / properties / op / title
      Removed value: -"Op"
    • removedInput schema / $defs / UdfFilter / properties / udf / title
      Removed value: -"Udf"
    • removedInput schema / $defs / UdfFilter / properties / value / title
      Removed value: -"Value"
    • removedInput schema / $defs / UdfFilter / title
      Removed value: -"UdfFilter"
    • removedInput schema / properties / code_prefix / title
      Removed value: -"Code Prefix"
    • removedInput schema / properties / code_type / title
      Removed value: -"Code Type"
    • removedInput schema / properties / code_value / title
      Removed value: -"Code Value"
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "full",
      +  "description": "brief: rows without their null values; full (default): every key.",
      +  "enum": [
      +    "full",
      +    "brief"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / fields / title
      Removed value: -"Fields"
    • removedInput schema / properties / finish_before / title
      Removed value: -"Finish Before"
    • removedInput schema / properties / include_child_codes / title
      Removed value: -"Include Child Codes"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • removedInput schema / properties / max_total_float_days / title
      Removed value: -"Max Total Float Days"
    • removedInput schema / properties / name_contains / title
      Removed value: -"Name Contains"
    • removedInput schema / properties / offset / title
      Removed value: -"Offset"
    • removedInput schema / properties / project / title
      Removed value: -"Project"
    • removedInput schema / properties / start_after / title
      Removed value: -"Start After"
    • removedInput schema / properties / status / title
      Removed value: -"Status"
    • removedInput schema / properties / udf_filter / title
      Removed value: -"Udf Filter"
    • removedInput schema / properties / udfs / title
      Removed value: -"Udfs"
    • removedInput schema / properties / wbs_name_contains / title
      Removed value: -"Wbs Name Contains"
    • removedInput schema / title
      Removed value: -"p6_query_activitiesArguments"
  3. Changed3 schema fields changedv1.5.1
    • addedInput schema / $defs
      Added value: +{
      +  "UdfFilter": {
      +    "description": "Activities whose UDF value matches: op (default eq) against value (not for empty / not_empty).",
      +    "properties": {
      +      "op": {
      +        "enum": [
      +          "eq",
      +          "ne",
      +          "lt",
      +          "le",
      +          "gt",
      +          "ge",
      +          "contains",
      +          "empty",
      +          "not_empty"
      +        ],
      +        "title": "Op",
      +        "type": "string"
      +      },
      +      "udf": {
      +        "title": "Udf",
      +        "type": "string"
      +      },
      +      "value": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "number"
      +          }
      +        ],
      +        "title": "Value"
      +      }
      +    },
      +    "required": [
      +      "udf"
      +    ],
      +    "title": "UdfFilter",
      +    "type": "object"
      +  }
      +}
    • addedInput schema / properties / udf_filter
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "UDF conditions, all must hold.",
      +      "items": {
      +        "$ref": "#/$defs/UdfFilter"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Udf Filter"
      +}
    • addedInput schema / properties / udfs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "UDF labels (as in P6 columns) to add to each row under 'udfs'.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Udfs"
      +}
  4. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description still adds real behavioral detail: result ordering by start (actual, else early) then Activity ID, the exact page envelope keys, that finish_before is inclusive of that day, that durations/float are in each activity's own calendar days, and that 'udfs' values are None when empty. It stops short of permissions, row-count costs or error behavior, so 4 rather than 5.

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?

Purpose is front-loaded, but the rest is a run-on block of semicolon-free clauses mixing pagination, ordering, code filtering, UDF filtering and projection with no separation. Every fact roughly earns its place for a 17-parameter tool, but the structure makes it hard to scan and some phrasing ('code_filter tells what matched', 'kept whole in brief rows') assumes context the reader may not have.

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

Completeness4/5

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

With no output schema and 17 parameters, the description does the heavy lifting: it documents the page envelope, ordering, projection and UDF behavior. Gaps remain for name_contains, status, code_prefix and max_total_float_days, which neither schema nor description fully explain, so it is complete but not exhaustive.

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 only 53% across 17 parameters, but the description compensates heavily: code_type precedence (project type wins over EPS/global), code_value matching by path/short name/name with child codes unless include_child_codes=False, fields= keeping task_code plus named fields, udf_filter all-must-hold semantics with date-day coverage, and wbs_name_contains scoped to the activity's own WBS node only. Undocumented remainder (name_contains, status, max_total_float_days, code_prefix) keeps it from a 5.

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?

States a specific verb+resource ('Search activities, one page {total, offset, returned, next_offset, rows}') and adds ordering and pagination shape, so an agent knows exactly what it gets back. It implicitly separates itself from p6_get_activity by being a paged search, but never names that sibling or any other alternative, keeping it short of a 5.

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

Usage Guidelines3/5

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

There is no explicit when-to-use / when-not-to-use guidance and no alternative named from the sibling set. The description does route the agent to helper tools for specific sub-tasks ('a whole branch: p6_list_wbs', labels 'as p6_list_udfs shows them'), which implies usage contexts without stating them.

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