Skip to main content

Tool Providers and governed tools

A ToolProvider is a configured source of tools. V1 supports AEP extensions and generic MCP servers over STDIO or Streamable HTTP. A provider owns connection and discovery configuration; it does not grant an agent permission to use anything.

Discovery materializes every announced capability as an Agentstration.Tools/tools resource. New resources are discovered = true, available = true, and enabled = false. Refresh updates provider-owned descriptions, metadata and MCP schemas while preserving the administrator-owned enabled flag. A missing tool remains persisted with available = false; reappearance restores availability.

provider enabled
AND tool enabled
AND tool available
AND canonical Tool resource assigned to Agent
-> exposed to MAF

MCP remains authoritative for protocol negotiation, tools/list, schemas, invocation and results. AEP contributes only extension identity, display metadata and mappings to MCP. Agent definitions never contain a command, endpoint or raw MCP declaration.

At invocation, Tool input validation accepts type as one supported JSON Schema type name or a non-empty array of distinct supported names. A value must match at least one declared type, and the corresponding constraints remain enforced. For example, ["object", "null"] accepts either an object or null; "object" alone rejects null. Making a property optional permits omission, not an otherwise invalid null value. Object inference from properties applies only when type is absent.

A malformed type declaration at a validated schema node raises tool_input_schema_invalid, including unknown names, empty arrays, duplicate names, and non-string array entries. Validation does not rewrite the provider schema or coerce argument values. Required properties, unknown-property restrictions, enums, bounds, array constraints, and the existing nesting and payload limits still apply.

Tool resolution and Tool execution are separate runtime responsibilities. The catalog returns provider-neutral descriptors (identity, schema, availability and approval metadata); it does not return an invocable MCP object. Microsoft Agent Framework receives an Agentstration-owned function adapter, and every effective invocation crosses IToolExecutionPipeline before the provider-specific IToolInvoker issues MCP tools/call. Direct MCP and AEP-to-MCP providers share this boundary:

Agent / MAF
-> Tool resource resolution
-> Agentstration Tool Execution Pipeline
-> MCP Tool invoker
-> MCP tools/call

The pipeline emits provider-neutral lifecycle facts before invocation and after completion, failure, or cancellation. Runtime Runs project a logical RuntimeToolCall; Flow Runs append Tool Call events to their own journal. ToolCallId identifies the logical call across replay, while InvocationId and the projected attempt number distinguish physical attempts. Arguments and provider results are not durably projected by default. Lifecycle sinks are observability ports only and remain separate from execution hooks.

Locally registered IToolExecutionHook guards run in stable order before MCP invocation and unwind in reverse order with a terminal outcome. A hook may allow or deny a call; it cannot currently mutate arguments, inspect or replace the provider result, or request approval. Denials never reach MCP and are projected separately from provider and hook failures. Every physical at-least-once attempt runs the hooks again.

Workspace-owned ToolExecutionHook resources add dynamic selection by canonical Tool, Tool Provider and Agent name. Empty selector lists mean “all”; populated selector dimensions are combined with AND semantics. Only built-in handlers are accepted. The current deny handler requires a stable code and a diagnostic message; resources cannot reference executable types, scripts, commands or remote endpoints. The Runtime resolves these resources through the current Tenant/Workspace-scoped Management store for every physical attempt.

apiVersion: agentstration.io/v1
kind: ToolExecutionHook
metadata:
name: block-sensitive-lookup
definition:
displayName: Block sensitive lookup
enabled: true
order: 100
handler: deny
selector:
tools: [sensitive-lookup]
providers: []
agents: []
configuration:
code: sensitive_lookup_denied
message: This Tool is disabled by workspace governance.

requiresApproval remains a native Tool policy. Agentstration wraps its own function adapter in MAF ApprovalRequiredAIFunction, preserving durable RequestInfoEvent → InputRequest → WaitingForInput → checkpoint resume behavior. After approval, the resumed invocation enters the Agentstration pipeline and its hook chain. The boundary carries logical Tool Call and physical invocation identities plus the available Tenant, Workspace, Principal, Run, Agent, revision, correlation and argument context. It does not implement automatic retries, provider idempotency or exactly-once effects.

STDIO environment values are not persisted. environmentReferences maps child-process variable names to host configuration keys, resolved only when connecting. OAuth, a durable secret store, scheduled polling, MCP Resources and MCP Prompts are outside this iteration.

Product-owned ToolDefinitions​

ToolDefinitions publish Flow, relay and acquisition Tools using toolKind variants and independent immutable versions. Relays bind literal, Parameter or Secret inputs and keep exact source revisions under normal governance. See ToolDefinitions and parameter relays and ADR-0202.