Skip to main content
Glama

Add a tool (connector, MCP server, flow, prompt, agent, or raw)

cs_add_tool

Adds a tool to a Copilot Studio agent by generating action YAML for connectors, MCP, flows, prompts, agents, or raw tasks; preview first, then confirm to write.

Instructions

Create actions/.mcs.yml. type 'connector': a connector operation (connectorId like shared_office365, operationId like SendEmailV2; use cs_list_connectors / cs_describe_connector to find them). type 'mcp': an MCP server exposed through a connector. type 'flow': a cloud flow by id. type 'prompt': an AI Builder prompt by model id (cs_list_prompts). type 'connected-agent': another Copilot Studio agent by schema name. type 'child-agent': a child agent's GPT component. type 'raw': any other TaskAction kind with the action object supplied. When the connector definition is cached, the operationId is checked and required inputs are filled from the catalog unless inputs are given. Connector and MCP tools need a connection that only the portal can authorise; the tool writes the connection-reference stub and returns the portal step. The first call changes nothing: it returns the files it would write, as a diff against what is there now, for the user to approve. Call it again with the same arguments plus confirm: true to write them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
typeYes
actionNotype raw: full TaskAction object with kind
flowIdNo
inputsNo
confirmNoRequired to write the change to the file. Without it the tool returns a preview - the changed lines against the current ones, and the character count - and writes nothing.
outputsNo
aiModelIdNotype prompt: AI Builder model id
overwriteNo
workspaceNoPath to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory.
connectorIdNoshared_<name> or a display name from the catalog
descriptionYesAlso used as modelDescription unless overridden; the orchestrator routes on it
operationIdNo
botSchemaNameNotype connected-agent
connectionModeNoInvoker = end user's connection; Maker = the maker's shared connection
modelDescriptionNo
inputsFromCatalogNoDefault true: when no inputs are given and the connector definition is cached, add automatic inputs for the operation's required parameters
connectionReferenceNoExisting logical name from connectionreferences.mcs.yml
gptComponentSchemaNameNotype child-agent

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.8
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / action / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / inputs / items / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "description": {
      -        "type": "string"
      -      },
      -      "entity": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "automatic",
      -        "type": "string"
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "shouldPromptUser": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "name",
      -      "description"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "manual",
      -        "type": "string"
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "value": {
      -        "description": "Literal or Power Fx (=System.User.Email)",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "name",
      -      "value"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "description": {
      +        "type": "string"
      +      },
      +      "entity": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "automatic",
      +        "type": "string"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "shouldPromptUser": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "name",
      +      "description"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "kind": {
      +        "const": "manual",
      +        "type": "string"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Literal or Power Fx (=System.User.Email)",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "name",
      +      "value"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changedv0.1.7
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Required to write the change to the file. Without it the tool returns a preview - the changed lines against the current ones, and the character count - and writes nothing.",
      +  "type": "boolean"
      +}
  3. First observedv0.1.5

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses that connector/MCP tools require a portal-only connection, that a connection-reference stub is written, that catalog caching auto-fills inputs, and that the first call is a no-op diff preview requiring confirm:true to actually write. This is exactly the operational context an agent needs before invoking a mutation.

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?

Front-loaded with the file artifact, then type semantics, then the confirmation workflow — a logical order with little filler. It is dense and long, but for a 19-parameter tool nearly every clause carries information.

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 19-param, no-annotation, no-output-schema mutation tool, the description covers the write/preview protocol, the return format (diff against current file with character count), authorization prerequisites, and per-type parameter expectations. Nothing essential to calling it correctly is missing.

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 coverage is only 58%, but the description compensates by mapping types to parameters (connectorId/operationId for connector, flowId for flow, aiModelId for prompt, botSchemaName for connected-agent, gptComponentSchemaName for child-agent, action for raw) and by explaining the confirm/inputsFromCatalog behavior. Remaining ambiguity (outputs, overwrite, workspace) is not addressed, so it falls short of fully covering the gap.

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?

Opens with a concrete verb and artifact ('Create actions/<name>.mcs.yml') and then enumerates every accepted type with what each one means, so the agent knows exactly what this tool produces. It is clearly distinguishable from siblings like cs_add_flow or cs_edit_tool.

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?

Gives per-type routing guidance (cs_list_connectors / cs_describe_connector to find connector ops, cs_list_prompts for prompts) and explains the two-step preview-then-confirm workflow. It does not explicitly contrast itself with cs_add_flow or cs_edit_tool, so the alternative selection is implied rather than stated.

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

Deploy Server

Other Tools