Skip to main content
Glama

Publish Appointments to Dynamics 365

publish_appointments_to_dataverse
Destructive

Microsoft Copilot (Entra sign-in): writes Dynamics 365 Appointments onto reps' calendars, one per account in a route or dated schedule; Outlook syncs from Dynamics. Takes map_session_id or ts_handle and one source. route_ids (calculate_route): start = departure + drive time + earlier onsite time (time_basis=routed); route_departures supplies a missing depart_at. visit_layer (schedule_visits with calendar dates): stacks each rep's day from day_start_time (time_basis=approximate). Appointments cover onsite time; drive time goes in the description. Visits without saved onsite time require default_duration_minutes (no default; returns needs_appointment_duration). organizer_map maps a route or rep to a Dynamics user, else default_organizer, else the signed-in user. confirm=false (default) previews (confirmation_required, organizers, counts, preview_appointments, ask_user); confirm=true queues the write. Repeat publishes update earlier open appointments. Account columns use publish_to_dataverse.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "publish_appointments_to_dataverse"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoFalse (default) runs the read-only preflight. True queues the write after the user confirms the count, the calendars, and the times.
timezoneNoIANA time zone of the visits (e.g. America/New_York). Required for visit_layer and for a route departure that carries no UTC offset. No default.
rep_fieldNovisit_layer only: visit column naming the rep. Default contractor_label.
route_idsNocalculate_route route_id values to publish (exact clock times). Exclusive with visit_layer.
ts_handleNoTerritory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline.
gap_minutesNovisit_layer only: minutes left between stacked visits. Default 0.
visit_layerNoschedule_visits visit layer (e.g. accounts_visits) to publish with approximate times. Needs schedule dates, timezone, and day_start_time. Exclusive with route_ids.
organizer_mapNoRoute label, route_id, or rep name -> Dynamics user (full name, email, or systemuserid). That user owns and organizes the appointments.
day_start_timeNovisit_layer only: local time each rep's day starts, HH:MM 24-hour. No default.
map_session_idNoOpen map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.
subject_prefixNoSubject is '<prefix>: <account name>'. Default 'Visit'.
environment_urlNoDynamics 365 environment (e.g. https://contoso.crm.dynamics.com). Defaults to the environment the accounts were imported from, or the user's sole environment.
route_departuresNoroute_id -> local start date-time (YYYY-MM-DDTHH:MM) for a route with no depart_at, or to move a route to another day.
default_organizerNoDynamics user for visits with no rep. Defaults to the signed-in user.
default_duration_minutesNoMinutes for any stop with no saved onsite (dwell) time; sets appointment length and spacing before the next stop. No default (required when any visit lacks dwell_minutes). default_duration_used_count reports how many used it.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true. A submission returns the task reference (task_id, next_action, sleep_ms); the completed task result carries the remaining fields.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / default_duration_minutes / anyOf
      Added value: +[
      +  {
      +    "maximum": 480,
      +    "minimum": 5,
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / default_duration_minutes / default
      Previous value: -30New value: +null
    • changedInput schema / properties / default_duration_minutes / description
      Previous value: -"Appointment length for a stop with no onsite (dwell) time. Default 30. default_duration_used_count reports how many used it."New value: +"Minutes for any stop with no saved onsite (dwell) time; sets appointment length and spacing before the next stop. No default (required when any visit lacks dwell_minutes). default_duration_used_count reports how many used it."
    • removedInput schema / properties / default_duration_minutes / maximum
      Removed value: -480
    • removedInput schema / properties / default_duration_minutes / minimum
      Removed value: -5
    • removedInput schema / properties / default_duration_minutes / type
      Removed value: -"number"
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the default dry-run behavior, what the preflight returns (confirmation_required, organizers, counts, preview_appointments, ask_user), that repeat publishes update earlier open appointments, and the failure path (needs_appointment_duration). Auth context (Entra sign-in) and organizer resolution order (organizer_map -> default_organizer -> signed-in user) are also spelled out, which the destructiveHint/idempotentHint flags alone could not convey.

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?

Purpose and auth mode are front-loaded in the first clause, and nearly every sentence carries non-redundant operational detail. The cost is density: semicolon-chained fragments like "route_ids (calculate_route): start = departure + drive time + earlier onsite time (time_basis=routed)" are packed tightly enough to slow parsing, though little text is genuinely wasted.

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 15-parameter, destructive, environment-scoped write tool, the description covers prerequisites (timezone required for visit_layer, day_start_time needed), source exclusivity, the preview/commit split, organizer fallback, and required duration handling. With an output schema present, it correctly omits return-value documentation and spends its words on behavior an agent must decide on.

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 100%, so the schema already defines each of the 15 parameters; the description still adds cross-parameter meaning the schema cannot, such as time_basis=routed for routes vs approximate for visit layers, that drive time belongs in the appointment description rather than its own block, and the confirmation chain for missing dwell time. Minor deduction because some clauses compress multiple parameters into terse notation that is harder to parse than the schema itself.

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?

States a specific verb and resource: writes Dynamics 365 Appointments onto reps' calendars, one per account in a route or dated schedule, plus the Outlook sync consequence. It also distinguishes the sibling publish_to_dataverse explicitly ("Account columns use publish_to_dataverse"), so an agent can route between the two write tools without opening schemas.

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

Usage Guidelines5/5

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

Gives explicit source selection ("Takes map_session_id or ts_handle and one source"), states the exclusivity of route_ids vs visit_layer, and prescribes the two-phase flow (confirm=false previews, confirm=true queues the write after user confirmation). It also names the upstream producers (calculate_route, schedule_visits) that make each source valid, which is exactly the when-to-use context an agent needs.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources