d365fo-client: Command for GitHub Copilot

.github/prompts/odata-action.prompt.md

odata-action is a command for GitHub Copilot from mafzaal/d365fo-client. It costs 11 tokens per session (2,450 once invoked), scanned A, original, MIT.

A step-by-step command for adding an OData action to a Python client for Microsoft Dynamics 365 Finance and Operations. OData is a web protocol for reading and changing structured business data, and the command checks the action's metadata before implementing it.

In plain words
What is it for?
Use it to find an action in Dynamics metadata and implement the correctly typed method for static, single-record, or collection actions.
Why use it?
It reduces mistakes caused by using the wrong action name, parameters, or binding type. Binding type means whether an action applies to nothing, one record, or a group of records.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

This is mafzaal/d365fo-client's own configuration. It tells GitHub Copilot how to work on d365fo-client itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything d365fo-client configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mafzaal/d365fo-client. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mafzaal/d365fo-client/main/.github/prompts/odata-action.prompt.md
Clone the repo
git clone --depth 1 https://github.com/mafzaal/d365fo-client

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for odata-action

README.md
[![agentmods](https://agentmods.dev/badge/commands/mafzaal/d365fo-client/odata-action/github.svg)](https://agentmods.dev/commands/mafzaal/d365fo-client/odata-action)
Your own site
<a href="https://agentmods.dev/commands/mafzaal/d365fo-client/odata-action"><img src="https://agentmods.dev/badge/commands/mafzaal/d365fo-client/odata-action/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for odata-action

Your own site · 80×15
<a href="https://agentmods.dev/commands/mafzaal/d365fo-client/odata-action"><img src="https://agentmods.dev/badge/commands/mafzaal/d365fo-client/odata-action.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.02450
Opus 5.5 $0.00004 $0.00980
Sonnet 5.5 $0.00002 $0.00490
Haiku 4.5 $0.00001 $0.00245

Measured 1mo ago against content hash b9e31b42830b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

odata-action scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/odata-action.prompt.md · 370 lines

How it starts

The opening of the file, as written. The whole thing — 370 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OData Action Implementation Prompt

You are a Python developer working on the d365fo-client package. Your task is to implement a method for calling an OData action in Microsoft Dynamics 365 Finance & Operations. Follow these steps systematically:

Step 1: Search and Analyze Action Metadata

First, search the metadata to find details about the OData action:

# Search for the action in the metadata
action_info = client.get_action_info("ActionName")

# If not found in cached metadata, search in PublicEntities
entity_info = await client.get_public_entity_info("EntityName")
if entity_info and entity_info.actions:
    action_info = next((a for a in entity_info.actions if a.name == "ActionName"), None)

Step 2: Determine Action Binding Type

Analyze if the action is:

  • Static Action: Not bound to any entity (is_bound=False or binding_kind="")
  • Entity Bound: Bound to a single entity instance (binding_kind="Entity")
  • Collection Bound: Bound to an entity set (binding_kind="Collection")
if action_info.binding_kind == "Entity":
    # Entity-bound action - requires entity key
    binding_type = "entity"
elif action_info.binding_kind == "Collection":
    # Collection-bound action - operates on entity set
    binding_type = "collection"
else:
    # Static action - no binding required
    binding_type = "static"

Step 3: Analyze Parameters and Return Type

Extract parameter information and return type:

# Analyze parameters
parameters = []
for param in action_info.parameters:
    param_info = {
        'name': param.name,
        'type': param.type.type_name,
        'is_collection': param.type.is_collection,
        'is_optional': False  # Determine from metadata
    }
    parameters.append(param_info)

# Analyze return type
return_type = None
if action_info.return_type:
    return_type = {
        'type': action_info.return_type.type_name,
        'is_collection': action_info.return_type.is_collection
    }

Read the full file on GitHub · 370 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 370 lines · 11 tokens per session scan A b9e31b42830b

Subscribe to this mod's changes

odata-action is a command published in the GitHub repository mafzaal/d365fo-client (40 stars, last pushed 3d ago), licensed MIT. It adds 11 tokens to every session and 2,450 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-11.