Skip to main content
Glama

Generate agent instructions with an AI Builder prompt

cs_generate_instructions

Generate or revise a Copilot Studio agent's system instructions from purpose, audience, tone, and boundaries, using AI Builder models. Previews changes without writing; apply with confirmation to update the agent's instruction file.

Instructions

Write the agent's instructions for it - the system prompt that decides how it answers. Builds a brief from purpose, audience, tone, capabilities, boundaries and examples, send it to an AI Builder prompt or model (pac copilot model predict; pick one with cs_list_prompts), and return the generated instructions. With apply: true the text is written into the agent's instructions (agent.mcs.yml, or settings.mcs.yml for cli-copilot), and only with confirm: true as well - without it the generated text comes back with the change it would make and the character count, and nothing is written. Pass currentInstructions/changeRequest (or refine: true to read the workspace) to revise existing instructions instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toneNo
applyNoWrite the result into the agent instructions (needs confirm: true as well)
refineNoRevise the workspace's current instructions using changeRequest
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.
modelIdNo
purposeNoWhat the agent is for; required unless refining
audienceNo
examplesNo
languageNo
inputModeNo
modelNameNoFull or partial AI Builder model / prompt name
workspaceNoPath to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory.
boundariesNo
environmentNoEnvironment id or URL. Defaults to the active pac auth profile.
capabilitiesNoDefault: derived from the workspace (topics, knowledge, tools)
changeRequestNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.7
    • changedInput schema / properties / apply / description
      Previous value: -"Write the result into the agent instructions"New value: +"Write the result into the agent instructions (needs confirm: true as well)"
    • 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"
      +}
  2. First observedv0.1.5

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it does well: it explicitly says nothing is written unless both apply: true and confirm: true are set, and that without them it returns a diff preview and character count. It also discloses the target files and the revision behavior, making the side-effect profile clear.

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?

The description is a bit dense but well-structured: it opens with purpose, then explains inputs and model selection, then the apply/confirm guardrail, then the revision mode. Every sentence earns its place for a complex 16-parameter tool, though the heavy use of parentheticals makes it slightly harder to parse.

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?

For a tool with no annotations, no output schema, and many parameters, the description covers the core workflow, safety guardrails, preview behavior, target files, and refinement path. It does not fully spell out every optional parameter or the success return after apply, but an agent has enough context to invoke the tool correctly in its main scenarios.

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 50%, so the description adds meaningful value by explaining how purpose, audience, tone, capabilities, boundaries, and examples form the generated brief, and how apply/confirm/refine/changeRequest interact. However, it does not add semantics for optional params like inputMode, language, modelId, or environment, though some of those already have schema descriptions.

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 states a clear verb+resource: it writes/generates the agent's system-prompt instructions, with an explicit mechanism via an AI Builder prompt or model. It also distinguishes the tool from sibling agent-edit tools by focusing specifically on instruction generation and optional application to agent.mcs.yml/settings.mcs.yml.

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?

It gives clear usage modes: generate new instructions, optionally apply with apply+confirm, and revise existing instructions via currentInstructions/changeRequest or refine: true. It also tells the agent to pick a prompt with cs_list_prompts. It does not explicitly call out sibling alternatives like cs_update_agent, but the context is sufficient.

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