azurefunctions-agents-runtime 0.0.0.dev6__tar.gz → 0.1.0b3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/PKG-INFO +61 -55
  2. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/README.md +60 -54
  3. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/pyproject.toml +4 -1
  4. azurefunctions_agents_runtime-0.1.0b3/src/azure_functions_agents/__init__.py +145 -0
  5. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/app.py +64 -9
  6. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/client_manager.py +18 -12
  7. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/__init__.py +6 -4
  8. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/env.py +7 -6
  9. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/loader.py +1 -1
  10. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/merge.py +18 -21
  11. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/paths.py +3 -2
  12. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/schema.py +20 -13
  13. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/validation.py +9 -5
  14. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/mcp.py +4 -5
  15. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/public/index.html +5 -5
  16. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/__init__.py +3 -3
  17. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/_naming.py +2 -2
  18. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/endpoints.py +39 -77
  19. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/triggers.py +1 -22
  20. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/runner.py +30 -39
  21. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/system_tools/sandbox.py +70 -39
  22. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/PKG-INFO +61 -55
  23. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/SOURCES.txt +1 -0
  24. azurefunctions_agents_runtime-0.1.0b3/tests/test_app.py +411 -0
  25. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_client_manager.py +9 -9
  26. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_fixtures.py +31 -39
  27. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_loader.py +7 -10
  28. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_merge.py +41 -34
  29. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_paths.py +2 -2
  30. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_schema.py +18 -7
  31. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_validation.py +45 -9
  32. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_mcp.py +2 -2
  33. azurefunctions_agents_runtime-0.1.0b3/tests/test_maf_warning_suppression.py +183 -0
  34. azurefunctions_agents_runtime-0.1.0b3/tests/test_package_imports.py +47 -0
  35. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_endpoints.py +82 -49
  36. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_handlers.py +17 -17
  37. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_triggers.py +15 -5
  38. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_runner_streaming.py +30 -20
  39. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_sandbox_session_id.py +3 -5
  40. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_system_tools_sandbox.py +2 -2
  41. azurefunctions_agents_runtime-0.0.0.dev6/src/azure_functions_agents/__init__.py +0 -55
  42. azurefunctions_agents_runtime-0.0.0.dev6/tests/test_app.py +0 -193
  43. azurefunctions_agents_runtime-0.0.0.dev6/tests/test_package_imports.py +0 -22
  44. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/LICENSE.md +0 -0
  45. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/setup.cfg +0 -0
  46. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_blob_history.py +0 -0
  47. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_credential.py +0 -0
  48. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_function_tool.py +0 -0
  49. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_logger.py +0 -0
  50. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/__init__.py +0 -0
  51. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/skills.py +0 -0
  52. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/tools.py +0 -0
  53. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/_handlers.py +0 -0
  54. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/capabilities.py +0 -0
  55. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/system_tools/__init__.py +0 -0
  56. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/dependency_links.txt +0 -0
  57. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/requires.txt +0 -0
  58. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/top_level.txt +0 -0
  59. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_blob_history.py +0 -0
  60. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_env.py +0 -0
  61. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_skills.py +0 -0
  62. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_tools.py +0 -0
  63. {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_capabilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azurefunctions-agents-runtime
3
- Version: 0.0.0.dev6
3
+ Version: 0.1.0b3
4
4
  Summary: A markdown-first programming model for building AI agents on Azure Functions, powered by the Microsoft Agent Framework.
5
5
  License: MIT
6
6
  Requires-Python: >=3.13
@@ -58,21 +58,17 @@ azurefunctions-agents-runtime
58
58
 
59
59
  ## Model Provider Configuration
60
60
 
61
- The runtime uses Microsoft Agent Framework, which supports OpenAI, Azure OpenAI, and Microsoft Foundry as inference back-ends. Auto-detection picks the first provider whose env vars are set, in this order:
61
+ The runtime uses Microsoft Agent Framework, which supports Microsoft Foundry, Azure OpenAI, and OpenAI as inference back-ends. The public preview quickstart and samples use **Microsoft Foundry** as the primary path, pinned with `AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`.
62
62
 
63
- 1. `AZURE_OPENAI_ENDPOINT` Azure OpenAI
64
- 2. `FOUNDRY_PROJECT_ENDPOINT` Microsoft Foundry
65
- 3. `OPENAI_API_KEY` OpenAI
63
+ | Provider | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Required env vars | Notes |
64
+ | --- | --- | --- | --- |
65
+ | Microsoft Foundry | `foundry` | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL` | Recommended quickstart/sample path. Uses `DefaultAzureCredential`; run `az login` locally and set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
66
+ | Azure OpenAI | `azure_openai` | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | Alternative Azure-hosted provider. `AZURE_OPENAI_DEPLOYMENT` takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD). |
67
+ | OpenAI | `openai` | `OPENAI_API_KEY`, optional `AZURE_FUNCTIONS_AGENTS_MODEL` (default `gpt-4o-mini`) | Alternative non-Azure provider. `AZURE_FUNCTIONS_AGENTS_MODEL` applies directly for OpenAI. |
66
68
 
67
- You can pin the provider explicitly with `MAF_PROVIDER=openai|azure_openai|foundry`.
69
+ If `AZURE_FUNCTIONS_AGENTS_PROVIDER` is unset, auto-detection picks the first provider whose env vars are set, in this order: `AZURE_OPENAI_ENDPOINT` → `FOUNDRY_PROJECT_ENDPOINT` → `OPENAI_API_KEY`. Set `AZURE_FUNCTIONS_AGENTS_PROVIDER` to make the provider choice intentional.
68
70
 
69
- | Provider | Required env vars | Notes |
70
- | ----------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
71
- | OpenAI | `OPENAI_API_KEY`, optional `MAF_MODEL` (default `gpt-4o-mini`) | `MAF_MODEL` applies directly for OpenAI. |
72
- | Azure OpenAI | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | `AZURE_OPENAI_DEPLOYMENT` takes precedence over `MAF_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD); set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
73
- | Microsoft Foundry | `FOUNDRY_PROJECT_ENDPOINT`, optional `FOUNDRY_MODEL` | `FOUNDRY_MODEL` takes precedence over `MAF_MODEL`. Uses `DefaultAzureCredential`; set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
74
-
75
- Model resolution precedence is: explicit requested model > provider-specific env (`AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI, `FOUNDRY_MODEL` for Foundry) > `MAF_MODEL` > provider default.
71
+ Model resolution precedence is: explicit requested model > provider-specific env (`FOUNDRY_MODEL` for Foundry, `AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI) > `AZURE_FUNCTIONS_AGENTS_MODEL` > provider default.
76
72
 
77
73
  ## Quick Start
78
74
 
@@ -84,6 +80,8 @@ Create `main.agent.md`:
84
80
  ---
85
81
  name: My Agent
86
82
  description: A helpful assistant
83
+
84
+ builtin_endpoints: true
87
85
  ---
88
86
 
89
87
  You are a helpful assistant. Answer questions concisely.
@@ -101,7 +99,15 @@ app = create_function_app()
101
99
 
102
100
  > The app root is auto-detected from `AzureWebJobsScriptRoot` (set by `func start` and the Azure Functions host). You can override it with `create_function_app(app_root=Path(__file__).parent)` or the `AZURE_FUNCTIONS_AGENTS_APP_ROOT` env var.
103
101
 
104
- ### 3. Create `host.json`
102
+ ### 3. Create `agents.config.yaml`
103
+
104
+ ```yaml
105
+ # Default runtime configuration
106
+ model: $FOUNDRY_MODEL
107
+ timeout: 900
108
+ ```
109
+
110
+ ### 4. Create `host.json`
105
111
 
106
112
  ```json
107
113
  {
@@ -118,7 +124,7 @@ app = create_function_app()
118
124
  }
119
125
  ```
120
126
 
121
- ### 4. Create `requirements.txt`
127
+ ### 5. Create `requirements.txt`
122
128
 
123
129
  ```
124
130
  azurefunctions-agents-runtime
@@ -126,9 +132,9 @@ azurefunctions-agents-runtime
126
132
 
127
133
  Connector-backed tools are exposed through MCP servers in `mcp.json`, and connector-triggered apps use the Azure Functions Connector Extension through the Functions extension bundle. No package extra is required.
128
134
 
129
- ### 5. Set the model provider
135
+ ### 6. Set the model provider
130
136
 
131
- For local development with OpenAI:
137
+ For local development with Microsoft Foundry, sign in with `az login`, then create `local.settings.json`:
132
138
 
133
139
  ```json
134
140
  {
@@ -136,13 +142,14 @@ For local development with OpenAI:
136
142
  "Values": {
137
143
  "FUNCTIONS_WORKER_RUNTIME": "python",
138
144
  "AzureWebJobsStorage": "UseDevelopmentStorage=true",
139
- "OPENAI_API_KEY": "sk-...",
140
- "MAF_MODEL": "gpt-4o-mini"
145
+ "AZURE_FUNCTIONS_AGENTS_PROVIDER": "foundry",
146
+ "FOUNDRY_PROJECT_ENDPOINT": "https://<project-name>.<region>.services.ai.azure.com/api/projects/<project-name>",
147
+ "FOUNDRY_MODEL": "gpt-5.4"
141
148
  }
142
149
  }
143
150
  ```
144
151
 
145
- ### 6. Start Azurite (local storage emulator)
152
+ ### 7. Start Azurite (local storage emulator)
146
153
 
147
154
  The MCP server endpoint and non-HTTP triggers (timer, queue, blob, etc.) require a storage account. Locally, use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite) via Docker:
148
155
 
@@ -152,28 +159,28 @@ docker run -d --name azurite -p 10000:10000 -p 10001:10001 -p 10002:10002 \
152
159
  azurite --skipApiVersionCheck --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0
153
160
  ```
154
161
 
155
- ### 7. Run locally
162
+ ### 8. Run locally
156
163
 
157
164
  ```bash
158
165
  func start
159
166
  ```
160
167
 
161
- Your agent is now running at `http://localhost:7071/` with a built-in chat UI, HTTP API (`/agent/chat`, `/agent/chatstream`), and MCP server (`/runtime/webhooks/mcp`).
168
+ Your agent is now running at `http://localhost:7071/agents/main/` with a built-in chat UI, HTTP API (`/agents/main/chat`, `/agents/main/chatstream`), and MCP tool exposed through the Functions MCP endpoint (`/runtime/webhooks/mcp`).
162
169
 
163
170
  ## Features
164
171
 
165
172
  **Architecture overview:** see [`docs/architecture.md`](docs/architecture.md) for the module map and data flow pipeline.
166
173
 
167
- ### `main.agent.md`
174
+ ### Built-in endpoints
168
175
 
169
- Define an agent with a markdown file. When `main.agent.md` is present, the runtime automatically registers:
176
+ Any `.agent.md` file can opt into built-in endpoints with `builtin_endpoints`. The route slug comes from the `.agent.md` filename after sanitization, not from the display `name:` field.
170
177
 
171
- - **Chat UI** — built-in single-page web interface at the app root
172
- - **HTTP APIs** — `POST /agent/chat` (JSON) and `POST /agent/chatstream` (SSE)
173
- - **MCP server** — `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
178
+ - **Debug chat UI** — built-in single-page web interface at `/agents/{slug}/`
179
+ - **HTTP APIs** — `POST /agents/{slug}/chat` (JSON) and `POST /agents/{slug}/chatstream` (SSE)
180
+ - **MCP tool** — optional tool exposed through `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
174
181
  - **Session persistence** — multi-turn conversations stored in Azure Blob Storage via the runtime's `BlobHistoryProvider`, reusing the function app's `AzureWebJobsStorage` account
175
182
 
176
- Non-main agents can also opt into their own chat UI and HTTP debug endpoints with `debug.chat: true` (or `debug: true`), served at `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream`, where `{slug}` is derived from the `.agent.md` filename (not the display `name:` field). See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
183
+ If any built-in endpoint is enabled, `trigger` is optional. This allows endpoint-only agents as well as triggered agents that also expose a chat UI or API. `builtin_endpoints.debug_chat_ui: true` automatically enables the backing chat APIs. `builtin_endpoints: true` is shorthand for enabling all built-in endpoints, including the MCP tool. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
177
184
 
178
185
  ### Event-driven agents (`<name>.agent.md`)
179
186
 
@@ -201,10 +208,10 @@ description: What this agent does
201
208
 
202
209
  # Optional: system tools (code execution)
203
210
  system_tools:
204
- execute_in_sessions:
205
- session_pool_management_endpoint: $ACA_SESSION_POOL_ENDPOINT
211
+ dynamic_sessions_code_interpreter:
212
+ endpoint: $ACA_SESSION_POOL_ENDPOINT
206
213
 
207
- # For triggered agents only (not `main.agent.md`):
214
+ # Optional when builtin_endpoints is enabled; required otherwise:
208
215
  trigger:
209
216
  type: timer_trigger # or queue_trigger, connector_trigger, etc.
210
217
  args:
@@ -228,8 +235,8 @@ Agent instructions in markdown...
228
235
 
229
236
  ### Multiple functions from markdown
230
237
 
231
- - **`main.agent.md`** — creates HTTP chat, MCP, and UI endpoints. No other triggers are supported in this file.
232
- - **`<name>.agent.md`** — creates an event-triggered Azure Function. Exactly one trigger per file. With `debug.chat: true` (or `debug: true`), it also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream`. The sanitized filename stem becomes the base Azure Function name. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the non-main debug slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#debug`](docs/front-matter-spec.md#debug).
238
+ - **`*.agent.md` with `trigger`** — creates an event-triggered Azure Function. Exactly one trigger per file.
239
+ - **`*.agent.md` with `builtin_endpoints`** also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream` when chat endpoints are enabled, and can expose an MCP tool when `builtin_endpoints: true` or `builtin_endpoints.mcp: true`. The sanitized filename stem becomes the base Azure Function name and endpoint slug. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the built-in endpoint slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
233
240
 
234
241
  When a triggered function runs, the agent's markdown body is used as the system instructions. The prompt sent to the agent includes the trigger type and the serialized binding data:
235
242
 
@@ -295,8 +302,8 @@ Variable references are resolved inline at load time anywhere string values are
295
302
  name: Notifier
296
303
  description: Sends updates to $TEAM_NAME
297
304
  system_tools:
298
- execute_in_sessions:
299
- session_pool_management_endpoint: "https://$HOST/api"
305
+ dynamic_sessions_code_interpreter:
306
+ endpoint: "https://$HOST/api"
300
307
  ---
301
308
 
302
309
  Send a daily summary email to $TO_EMAIL.
@@ -305,7 +312,7 @@ Post a message to the %TEAM_NAME% team's General channel.
305
312
 
306
313
  If `HOST=contoso.internal`, `TO_EMAIL=alice@example.com`, and `TEAM_NAME=Engineering` are set in the environment, those values resolve inline:
307
314
 
308
- > `session_pool_management_endpoint: "https://contoso.internal/api"`
315
+ > `endpoint: "https://contoso.internal/api"`
309
316
  >
310
317
  > Send a daily summary email to alice@example.com.
311
318
  >
@@ -346,13 +353,13 @@ def reverse_string(text: str) -> str:
346
353
 
347
354
  `@tool` is re-exported from `agent_framework`. Functions can be sync or async; types in the signature feed MAF's automatic JSON-Schema generation. Tools that need richer schemas can be declared with `agent_framework.FunctionTool` directly.
348
355
 
349
- ## What `main.agent.md` Enables
356
+ ## Built-in Endpoint Routes
350
357
 
351
- When a `main.agent.md` file exists in your app root, the runtime automatically registers:
358
+ Built-in endpoints are explicit per agent. The filename stem determines `{slug}`; for example, `main.agent.md` uses `main` and `daily_azure_report.agent.md` uses `daily_azure_report`.
352
359
 
353
360
  ### Chat UI
354
361
 
355
- A built-in single-page chat interface served at `/` for the main agent, and at `/agents/{slug}/` for any non-main agent with `debug.chat: true` (or `debug: true`). For non-main agents, `{slug}` comes from the `.agent.md` filename after sanitization, not from the display `name:` field. No frontend code needed — just open `http://localhost:7071/` locally or `https://<your-app>.azurewebsites.net/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
362
+ A built-in single-page chat interface served at `/agents/{slug}/` when `builtin_endpoints.debug_chat_ui: true` (or `builtin_endpoints: true`). No frontend code needed — just open `http://localhost:7071/agents/main/` locally for `main.agent.md`, or `https://<your-app>.azurewebsites.net/agents/{slug}/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
356
363
 
357
364
  On first load, you'll be prompted for the base URL and a function key (for deployed apps). These are stored in browser local storage and can be changed via the gear icon.
358
365
 
@@ -360,8 +367,7 @@ On first load, you'll be prompted for the base URL and a function key (for deplo
360
367
 
361
368
  POST endpoints for programmatic access:
362
369
 
363
- - **Main agent:** `POST /agent/chat` and `POST /agent/chatstream`
364
- - **Non-main agent with `debug.chat: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream` (`{slug}` comes from the `.agent.md` filename after sanitization)
370
+ - **Any agent with `builtin_endpoints.chat_api: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream`
365
371
 
366
372
  The JSON endpoint returns `session_id`, `response`, and `tool_calls`. The streaming endpoint uses Server-Sent Events (SSE) with `session`, `delta`, `intermediate`, `tool_start`, `tool_end`, `done`, and `error` events.
367
373
 
@@ -369,11 +375,11 @@ Pass `x-ms-session-id` header to continue a conversation across requests. If omi
369
375
 
370
376
  ### MCP Server
371
377
 
372
- An MCP-compatible endpoint at `/runtime/webhooks/mcp` that any MCP client (VS Code, Claude Desktop, etc.) can connect to. Requires the MCP extension system key in the `x-functions-key` header when deployed.
378
+ When `builtin_endpoints: true` or `builtin_endpoints.mcp: true`, the agent is exposed as an MCP tool named after its slug through the shared MCP-compatible endpoint at `/runtime/webhooks/mcp`. Requires the MCP extension system key in the `x-functions-key` header when deployed.
373
379
 
374
- ### Without `main.agent.md`
380
+ ### Without built-in endpoints
375
381
 
376
- If there's no `main.agent.md`, the root (`/`) chat UI, `/agent/*` chat APIs, and `/runtime/webhooks/mcp` endpoint are disabled. The app still runs triggered functions, and non-main agents can still opt into per-agent chat surfaces with `debug.chat: true` (or `debug: true`). See [`docs/front-matter-spec.md#debug`](docs/front-matter-spec.md#debug).
382
+ If no agent enables built-in endpoints, no chat UI, chat API, chatstream, or agent MCP tool is registered. The app still runs triggered functions. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
377
383
 
378
384
  ## MCP Server Configuration
379
385
 
@@ -402,7 +408,6 @@ String values in `mcp.json` support inline environment-variable substitution wit
402
408
  "type": "http",
403
409
  "url": "$O365_MCP_SERVER_URL",
404
410
  "tools": ["office365_SendEmailV2"],
405
- "load_prompts": false,
406
411
  "auth": {
407
412
  "scope": "https://apihub.azure.com/.default",
408
413
  "client_id": "$O365_MCP_CLIENT_ID"
@@ -418,10 +423,10 @@ Tools from configured MCP servers are automatically available to the agent at ru
418
423
  - **`url`** — the MCP server endpoint URL (required)
419
424
  - **`headers`** — optional HTTP headers (e.g. for authentication)
420
425
  - **`tools`** — optional array of tool name patterns to allow (default: `["*"]`)
421
- - **`load_tools`** — optional boolean controlling whether tools are loaded from the MCP server (default: `true`)
422
- - **`load_prompts`** — optional boolean controlling whether prompts are loaded from the MCP server (default: `true`). Set this to `false` for MCP servers that do not implement `prompts/list`.
423
426
  - **`auth`** — optional Azure Identity authentication configuration. Set `auth.scope` to the token scope required by the MCP server. The runtime uses `DefaultAzureCredential` to acquire the token.
424
427
 
428
+ The runtime loads MCP tools and skips MCP prompts. This avoids startup/runtime failures from connector-backed MCP servers that support tools but reject `prompts/list`.
429
+
425
430
  By default, MCP auth follows the app-wide identity selection: `AZURE_CLIENT_ID` when set, otherwise the system-assigned identity/default Azure credential chain. To choose a user-assigned managed identity for a single MCP server without changing the app-wide identity, set `auth.client_id` in that server's `mcp.json` entry. If the configured client ID is empty or an unresolved placeholder, the runtime falls back to the app-wide identity selection.
426
431
 
427
432
  > **Note**: Entries without a `url`, with unresolved placeholders in `url`, or with a `type` other than `"http"` / `"streamable-http"`, are ignored with a warning. Use the remote HTTP transport instead.
@@ -445,7 +450,7 @@ Multi-turn conversations are persisted as JSON Lines, one record per message:
445
450
  - **Local dev fallback.** When neither `AzureWebJobsStorage` nor
446
451
  `AzureWebJobsStorage__blobServiceUri` is set, history falls back to MAF's
447
452
  `FileHistoryProvider` writing to
448
- `{AZURE_FUNCTIONS_AGENTS_CONFIG_DIR}/agent-sessions/{session_id}.jsonl`,
453
+ `{AZURE_FUNCTIONS_AGENTS_SESSION_DIR}/agent-sessions/{session_id}.jsonl`,
449
454
  defaulting to `~/.azure-functions-agents/agent-sessions/`.
450
455
 
451
456
  Session ids must match `^[A-Za-z0-9._-]{1,128}$` — anything else is rejected at the API boundary.
@@ -465,20 +470,21 @@ See the [`samples/`](samples/) directory for complete, deployable example apps:
465
470
 
466
471
  ### Required Azure App Settings
467
472
 
468
- Set the model provider env vars described above (e.g. `OPENAI_API_KEY` and `MAF_MODEL`, `AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`, or `FOUNDRY_PROJECT_ENDPOINT` + `FOUNDRY_MODEL`). For Azure OpenAI and Microsoft Foundry, the provider-specific deployment/model setting takes precedence over `MAF_MODEL`.
473
+ Set the model provider env vars described above. The preview samples use Microsoft Foundry (`AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`, `FOUNDRY_PROJECT_ENDPOINT`, and `FOUNDRY_MODEL`). Azure OpenAI (`AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`) and OpenAI (`OPENAI_API_KEY` and optionally `AZURE_FUNCTIONS_AGENTS_MODEL`) are supported alternatives. For Microsoft Foundry and Azure OpenAI, the provider-specific model/deployment setting takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`.
469
474
 
470
- When the agent uses connector-backed MCP servers, connector triggers, or `execution_sandbox`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server.
475
+ When the agent uses connector-backed MCP servers, connector triggers, or `dynamic_sessions_code_interpreter`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server. For an individual code interpreter pool, set `system_tools.dynamic_sessions_code_interpreter.client_id`.
471
476
 
472
477
  ### Optional config overrides
473
478
 
474
479
  | Setting | Purpose |
475
480
  |---|---|
476
481
  | `AZURE_FUNCTIONS_AGENTS_APP_ROOT` | Override the app root used to discover `*.agent.md`, `tools/`, `skills/`, and `mcp.json` |
477
- | `AZURE_FUNCTIONS_AGENTS_CONFIG_DIR` | Override the directory used for session storage |
478
- | `AGENT_TIMEOUT` | Per-call timeout in seconds (default `900`) |
479
- | `MAF_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
480
- | `MAF_REASONING_EFFORT` | Reasoning effort for supported reasoning models (default `high`; valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
481
- | `MAF_REASONING_SUMMARY` | Reasoning summary mode for supported reasoning models (default `concise`; valid values are `auto`, `concise`, `detailed`) |
482
+ | `AZURE_FUNCTIONS_AGENTS_SESSION_DIR` | Override the directory used for local session storage |
483
+ | `AZURE_FUNCTIONS_AGENTS_TIMEOUT_SECONDS` | Per-call timeout in seconds (default `900`) |
484
+ | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
485
+ | `AZURE_FUNCTIONS_AGENTS_MODEL` | Runtime-owned model fallback when no provider-specific model/deployment is set |
486
+ | `AZURE_FUNCTIONS_AGENTS_REASONING_EFFORT` | Optional reasoning effort for supported reasoning models (valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
487
+ | `AZURE_FUNCTIONS_AGENTS_REASONING_SUMMARY` | Optional reasoning summary mode for supported reasoning models (valid values are `auto`, `concise`, `detailed`) |
482
488
 
483
489
  ## Development
484
490
 
@@ -29,21 +29,17 @@ azurefunctions-agents-runtime
29
29
 
30
30
  ## Model Provider Configuration
31
31
 
32
- The runtime uses Microsoft Agent Framework, which supports OpenAI, Azure OpenAI, and Microsoft Foundry as inference back-ends. Auto-detection picks the first provider whose env vars are set, in this order:
32
+ The runtime uses Microsoft Agent Framework, which supports Microsoft Foundry, Azure OpenAI, and OpenAI as inference back-ends. The public preview quickstart and samples use **Microsoft Foundry** as the primary path, pinned with `AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`.
33
33
 
34
- 1. `AZURE_OPENAI_ENDPOINT` Azure OpenAI
35
- 2. `FOUNDRY_PROJECT_ENDPOINT` Microsoft Foundry
36
- 3. `OPENAI_API_KEY` OpenAI
34
+ | Provider | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Required env vars | Notes |
35
+ | --- | --- | --- | --- |
36
+ | Microsoft Foundry | `foundry` | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL` | Recommended quickstart/sample path. Uses `DefaultAzureCredential`; run `az login` locally and set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
37
+ | Azure OpenAI | `azure_openai` | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | Alternative Azure-hosted provider. `AZURE_OPENAI_DEPLOYMENT` takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD). |
38
+ | OpenAI | `openai` | `OPENAI_API_KEY`, optional `AZURE_FUNCTIONS_AGENTS_MODEL` (default `gpt-4o-mini`) | Alternative non-Azure provider. `AZURE_FUNCTIONS_AGENTS_MODEL` applies directly for OpenAI. |
37
39
 
38
- You can pin the provider explicitly with `MAF_PROVIDER=openai|azure_openai|foundry`.
40
+ If `AZURE_FUNCTIONS_AGENTS_PROVIDER` is unset, auto-detection picks the first provider whose env vars are set, in this order: `AZURE_OPENAI_ENDPOINT` → `FOUNDRY_PROJECT_ENDPOINT` → `OPENAI_API_KEY`. Set `AZURE_FUNCTIONS_AGENTS_PROVIDER` to make the provider choice intentional.
39
41
 
40
- | Provider | Required env vars | Notes |
41
- | ----------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
42
- | OpenAI | `OPENAI_API_KEY`, optional `MAF_MODEL` (default `gpt-4o-mini`) | `MAF_MODEL` applies directly for OpenAI. |
43
- | Azure OpenAI | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | `AZURE_OPENAI_DEPLOYMENT` takes precedence over `MAF_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD); set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
44
- | Microsoft Foundry | `FOUNDRY_PROJECT_ENDPOINT`, optional `FOUNDRY_MODEL` | `FOUNDRY_MODEL` takes precedence over `MAF_MODEL`. Uses `DefaultAzureCredential`; set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
45
-
46
- Model resolution precedence is: explicit requested model > provider-specific env (`AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI, `FOUNDRY_MODEL` for Foundry) > `MAF_MODEL` > provider default.
42
+ Model resolution precedence is: explicit requested model > provider-specific env (`FOUNDRY_MODEL` for Foundry, `AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI) > `AZURE_FUNCTIONS_AGENTS_MODEL` > provider default.
47
43
 
48
44
  ## Quick Start
49
45
 
@@ -55,6 +51,8 @@ Create `main.agent.md`:
55
51
  ---
56
52
  name: My Agent
57
53
  description: A helpful assistant
54
+
55
+ builtin_endpoints: true
58
56
  ---
59
57
 
60
58
  You are a helpful assistant. Answer questions concisely.
@@ -72,7 +70,15 @@ app = create_function_app()
72
70
 
73
71
  > The app root is auto-detected from `AzureWebJobsScriptRoot` (set by `func start` and the Azure Functions host). You can override it with `create_function_app(app_root=Path(__file__).parent)` or the `AZURE_FUNCTIONS_AGENTS_APP_ROOT` env var.
74
72
 
75
- ### 3. Create `host.json`
73
+ ### 3. Create `agents.config.yaml`
74
+
75
+ ```yaml
76
+ # Default runtime configuration
77
+ model: $FOUNDRY_MODEL
78
+ timeout: 900
79
+ ```
80
+
81
+ ### 4. Create `host.json`
76
82
 
77
83
  ```json
78
84
  {
@@ -89,7 +95,7 @@ app = create_function_app()
89
95
  }
90
96
  ```
91
97
 
92
- ### 4. Create `requirements.txt`
98
+ ### 5. Create `requirements.txt`
93
99
 
94
100
  ```
95
101
  azurefunctions-agents-runtime
@@ -97,9 +103,9 @@ azurefunctions-agents-runtime
97
103
 
98
104
  Connector-backed tools are exposed through MCP servers in `mcp.json`, and connector-triggered apps use the Azure Functions Connector Extension through the Functions extension bundle. No package extra is required.
99
105
 
100
- ### 5. Set the model provider
106
+ ### 6. Set the model provider
101
107
 
102
- For local development with OpenAI:
108
+ For local development with Microsoft Foundry, sign in with `az login`, then create `local.settings.json`:
103
109
 
104
110
  ```json
105
111
  {
@@ -107,13 +113,14 @@ For local development with OpenAI:
107
113
  "Values": {
108
114
  "FUNCTIONS_WORKER_RUNTIME": "python",
109
115
  "AzureWebJobsStorage": "UseDevelopmentStorage=true",
110
- "OPENAI_API_KEY": "sk-...",
111
- "MAF_MODEL": "gpt-4o-mini"
116
+ "AZURE_FUNCTIONS_AGENTS_PROVIDER": "foundry",
117
+ "FOUNDRY_PROJECT_ENDPOINT": "https://<project-name>.<region>.services.ai.azure.com/api/projects/<project-name>",
118
+ "FOUNDRY_MODEL": "gpt-5.4"
112
119
  }
113
120
  }
114
121
  ```
115
122
 
116
- ### 6. Start Azurite (local storage emulator)
123
+ ### 7. Start Azurite (local storage emulator)
117
124
 
118
125
  The MCP server endpoint and non-HTTP triggers (timer, queue, blob, etc.) require a storage account. Locally, use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite) via Docker:
119
126
 
@@ -123,28 +130,28 @@ docker run -d --name azurite -p 10000:10000 -p 10001:10001 -p 10002:10002 \
123
130
  azurite --skipApiVersionCheck --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0
124
131
  ```
125
132
 
126
- ### 7. Run locally
133
+ ### 8. Run locally
127
134
 
128
135
  ```bash
129
136
  func start
130
137
  ```
131
138
 
132
- Your agent is now running at `http://localhost:7071/` with a built-in chat UI, HTTP API (`/agent/chat`, `/agent/chatstream`), and MCP server (`/runtime/webhooks/mcp`).
139
+ Your agent is now running at `http://localhost:7071/agents/main/` with a built-in chat UI, HTTP API (`/agents/main/chat`, `/agents/main/chatstream`), and MCP tool exposed through the Functions MCP endpoint (`/runtime/webhooks/mcp`).
133
140
 
134
141
  ## Features
135
142
 
136
143
  **Architecture overview:** see [`docs/architecture.md`](docs/architecture.md) for the module map and data flow pipeline.
137
144
 
138
- ### `main.agent.md`
145
+ ### Built-in endpoints
139
146
 
140
- Define an agent with a markdown file. When `main.agent.md` is present, the runtime automatically registers:
147
+ Any `.agent.md` file can opt into built-in endpoints with `builtin_endpoints`. The route slug comes from the `.agent.md` filename after sanitization, not from the display `name:` field.
141
148
 
142
- - **Chat UI** — built-in single-page web interface at the app root
143
- - **HTTP APIs** — `POST /agent/chat` (JSON) and `POST /agent/chatstream` (SSE)
144
- - **MCP server** — `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
149
+ - **Debug chat UI** — built-in single-page web interface at `/agents/{slug}/`
150
+ - **HTTP APIs** — `POST /agents/{slug}/chat` (JSON) and `POST /agents/{slug}/chatstream` (SSE)
151
+ - **MCP tool** — optional tool exposed through `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
145
152
  - **Session persistence** — multi-turn conversations stored in Azure Blob Storage via the runtime's `BlobHistoryProvider`, reusing the function app's `AzureWebJobsStorage` account
146
153
 
147
- Non-main agents can also opt into their own chat UI and HTTP debug endpoints with `debug.chat: true` (or `debug: true`), served at `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream`, where `{slug}` is derived from the `.agent.md` filename (not the display `name:` field). See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
154
+ If any built-in endpoint is enabled, `trigger` is optional. This allows endpoint-only agents as well as triggered agents that also expose a chat UI or API. `builtin_endpoints.debug_chat_ui: true` automatically enables the backing chat APIs. `builtin_endpoints: true` is shorthand for enabling all built-in endpoints, including the MCP tool. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
148
155
 
149
156
  ### Event-driven agents (`<name>.agent.md`)
150
157
 
@@ -172,10 +179,10 @@ description: What this agent does
172
179
 
173
180
  # Optional: system tools (code execution)
174
181
  system_tools:
175
- execute_in_sessions:
176
- session_pool_management_endpoint: $ACA_SESSION_POOL_ENDPOINT
182
+ dynamic_sessions_code_interpreter:
183
+ endpoint: $ACA_SESSION_POOL_ENDPOINT
177
184
 
178
- # For triggered agents only (not `main.agent.md`):
185
+ # Optional when builtin_endpoints is enabled; required otherwise:
179
186
  trigger:
180
187
  type: timer_trigger # or queue_trigger, connector_trigger, etc.
181
188
  args:
@@ -199,8 +206,8 @@ Agent instructions in markdown...
199
206
 
200
207
  ### Multiple functions from markdown
201
208
 
202
- - **`main.agent.md`** — creates HTTP chat, MCP, and UI endpoints. No other triggers are supported in this file.
203
- - **`<name>.agent.md`** — creates an event-triggered Azure Function. Exactly one trigger per file. With `debug.chat: true` (or `debug: true`), it also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream`. The sanitized filename stem becomes the base Azure Function name. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the non-main debug slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#debug`](docs/front-matter-spec.md#debug).
209
+ - **`*.agent.md` with `trigger`** — creates an event-triggered Azure Function. Exactly one trigger per file.
210
+ - **`*.agent.md` with `builtin_endpoints`** also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream` when chat endpoints are enabled, and can expose an MCP tool when `builtin_endpoints: true` or `builtin_endpoints.mcp: true`. The sanitized filename stem becomes the base Azure Function name and endpoint slug. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the built-in endpoint slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
204
211
 
205
212
  When a triggered function runs, the agent's markdown body is used as the system instructions. The prompt sent to the agent includes the trigger type and the serialized binding data:
206
213
 
@@ -266,8 +273,8 @@ Variable references are resolved inline at load time anywhere string values are
266
273
  name: Notifier
267
274
  description: Sends updates to $TEAM_NAME
268
275
  system_tools:
269
- execute_in_sessions:
270
- session_pool_management_endpoint: "https://$HOST/api"
276
+ dynamic_sessions_code_interpreter:
277
+ endpoint: "https://$HOST/api"
271
278
  ---
272
279
 
273
280
  Send a daily summary email to $TO_EMAIL.
@@ -276,7 +283,7 @@ Post a message to the %TEAM_NAME% team's General channel.
276
283
 
277
284
  If `HOST=contoso.internal`, `TO_EMAIL=alice@example.com`, and `TEAM_NAME=Engineering` are set in the environment, those values resolve inline:
278
285
 
279
- > `session_pool_management_endpoint: "https://contoso.internal/api"`
286
+ > `endpoint: "https://contoso.internal/api"`
280
287
  >
281
288
  > Send a daily summary email to alice@example.com.
282
289
  >
@@ -317,13 +324,13 @@ def reverse_string(text: str) -> str:
317
324
 
318
325
  `@tool` is re-exported from `agent_framework`. Functions can be sync or async; types in the signature feed MAF's automatic JSON-Schema generation. Tools that need richer schemas can be declared with `agent_framework.FunctionTool` directly.
319
326
 
320
- ## What `main.agent.md` Enables
327
+ ## Built-in Endpoint Routes
321
328
 
322
- When a `main.agent.md` file exists in your app root, the runtime automatically registers:
329
+ Built-in endpoints are explicit per agent. The filename stem determines `{slug}`; for example, `main.agent.md` uses `main` and `daily_azure_report.agent.md` uses `daily_azure_report`.
323
330
 
324
331
  ### Chat UI
325
332
 
326
- A built-in single-page chat interface served at `/` for the main agent, and at `/agents/{slug}/` for any non-main agent with `debug.chat: true` (or `debug: true`). For non-main agents, `{slug}` comes from the `.agent.md` filename after sanitization, not from the display `name:` field. No frontend code needed — just open `http://localhost:7071/` locally or `https://<your-app>.azurewebsites.net/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
333
+ A built-in single-page chat interface served at `/agents/{slug}/` when `builtin_endpoints.debug_chat_ui: true` (or `builtin_endpoints: true`). No frontend code needed — just open `http://localhost:7071/agents/main/` locally for `main.agent.md`, or `https://<your-app>.azurewebsites.net/agents/{slug}/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
327
334
 
328
335
  On first load, you'll be prompted for the base URL and a function key (for deployed apps). These are stored in browser local storage and can be changed via the gear icon.
329
336
 
@@ -331,8 +338,7 @@ On first load, you'll be prompted for the base URL and a function key (for deplo
331
338
 
332
339
  POST endpoints for programmatic access:
333
340
 
334
- - **Main agent:** `POST /agent/chat` and `POST /agent/chatstream`
335
- - **Non-main agent with `debug.chat: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream` (`{slug}` comes from the `.agent.md` filename after sanitization)
341
+ - **Any agent with `builtin_endpoints.chat_api: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream`
336
342
 
337
343
  The JSON endpoint returns `session_id`, `response`, and `tool_calls`. The streaming endpoint uses Server-Sent Events (SSE) with `session`, `delta`, `intermediate`, `tool_start`, `tool_end`, `done`, and `error` events.
338
344
 
@@ -340,11 +346,11 @@ Pass `x-ms-session-id` header to continue a conversation across requests. If omi
340
346
 
341
347
  ### MCP Server
342
348
 
343
- An MCP-compatible endpoint at `/runtime/webhooks/mcp` that any MCP client (VS Code, Claude Desktop, etc.) can connect to. Requires the MCP extension system key in the `x-functions-key` header when deployed.
349
+ When `builtin_endpoints: true` or `builtin_endpoints.mcp: true`, the agent is exposed as an MCP tool named after its slug through the shared MCP-compatible endpoint at `/runtime/webhooks/mcp`. Requires the MCP extension system key in the `x-functions-key` header when deployed.
344
350
 
345
- ### Without `main.agent.md`
351
+ ### Without built-in endpoints
346
352
 
347
- If there's no `main.agent.md`, the root (`/`) chat UI, `/agent/*` chat APIs, and `/runtime/webhooks/mcp` endpoint are disabled. The app still runs triggered functions, and non-main agents can still opt into per-agent chat surfaces with `debug.chat: true` (or `debug: true`). See [`docs/front-matter-spec.md#debug`](docs/front-matter-spec.md#debug).
353
+ If no agent enables built-in endpoints, no chat UI, chat API, chatstream, or agent MCP tool is registered. The app still runs triggered functions. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
348
354
 
349
355
  ## MCP Server Configuration
350
356
 
@@ -373,7 +379,6 @@ String values in `mcp.json` support inline environment-variable substitution wit
373
379
  "type": "http",
374
380
  "url": "$O365_MCP_SERVER_URL",
375
381
  "tools": ["office365_SendEmailV2"],
376
- "load_prompts": false,
377
382
  "auth": {
378
383
  "scope": "https://apihub.azure.com/.default",
379
384
  "client_id": "$O365_MCP_CLIENT_ID"
@@ -389,10 +394,10 @@ Tools from configured MCP servers are automatically available to the agent at ru
389
394
  - **`url`** — the MCP server endpoint URL (required)
390
395
  - **`headers`** — optional HTTP headers (e.g. for authentication)
391
396
  - **`tools`** — optional array of tool name patterns to allow (default: `["*"]`)
392
- - **`load_tools`** — optional boolean controlling whether tools are loaded from the MCP server (default: `true`)
393
- - **`load_prompts`** — optional boolean controlling whether prompts are loaded from the MCP server (default: `true`). Set this to `false` for MCP servers that do not implement `prompts/list`.
394
397
  - **`auth`** — optional Azure Identity authentication configuration. Set `auth.scope` to the token scope required by the MCP server. The runtime uses `DefaultAzureCredential` to acquire the token.
395
398
 
399
+ The runtime loads MCP tools and skips MCP prompts. This avoids startup/runtime failures from connector-backed MCP servers that support tools but reject `prompts/list`.
400
+
396
401
  By default, MCP auth follows the app-wide identity selection: `AZURE_CLIENT_ID` when set, otherwise the system-assigned identity/default Azure credential chain. To choose a user-assigned managed identity for a single MCP server without changing the app-wide identity, set `auth.client_id` in that server's `mcp.json` entry. If the configured client ID is empty or an unresolved placeholder, the runtime falls back to the app-wide identity selection.
397
402
 
398
403
  > **Note**: Entries without a `url`, with unresolved placeholders in `url`, or with a `type` other than `"http"` / `"streamable-http"`, are ignored with a warning. Use the remote HTTP transport instead.
@@ -416,7 +421,7 @@ Multi-turn conversations are persisted as JSON Lines, one record per message:
416
421
  - **Local dev fallback.** When neither `AzureWebJobsStorage` nor
417
422
  `AzureWebJobsStorage__blobServiceUri` is set, history falls back to MAF's
418
423
  `FileHistoryProvider` writing to
419
- `{AZURE_FUNCTIONS_AGENTS_CONFIG_DIR}/agent-sessions/{session_id}.jsonl`,
424
+ `{AZURE_FUNCTIONS_AGENTS_SESSION_DIR}/agent-sessions/{session_id}.jsonl`,
420
425
  defaulting to `~/.azure-functions-agents/agent-sessions/`.
421
426
 
422
427
  Session ids must match `^[A-Za-z0-9._-]{1,128}$` — anything else is rejected at the API boundary.
@@ -436,20 +441,21 @@ See the [`samples/`](samples/) directory for complete, deployable example apps:
436
441
 
437
442
  ### Required Azure App Settings
438
443
 
439
- Set the model provider env vars described above (e.g. `OPENAI_API_KEY` and `MAF_MODEL`, `AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`, or `FOUNDRY_PROJECT_ENDPOINT` + `FOUNDRY_MODEL`). For Azure OpenAI and Microsoft Foundry, the provider-specific deployment/model setting takes precedence over `MAF_MODEL`.
444
+ Set the model provider env vars described above. The preview samples use Microsoft Foundry (`AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`, `FOUNDRY_PROJECT_ENDPOINT`, and `FOUNDRY_MODEL`). Azure OpenAI (`AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`) and OpenAI (`OPENAI_API_KEY` and optionally `AZURE_FUNCTIONS_AGENTS_MODEL`) are supported alternatives. For Microsoft Foundry and Azure OpenAI, the provider-specific model/deployment setting takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`.
440
445
 
441
- When the agent uses connector-backed MCP servers, connector triggers, or `execution_sandbox`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server.
446
+ When the agent uses connector-backed MCP servers, connector triggers, or `dynamic_sessions_code_interpreter`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server. For an individual code interpreter pool, set `system_tools.dynamic_sessions_code_interpreter.client_id`.
442
447
 
443
448
  ### Optional config overrides
444
449
 
445
450
  | Setting | Purpose |
446
451
  |---|---|
447
452
  | `AZURE_FUNCTIONS_AGENTS_APP_ROOT` | Override the app root used to discover `*.agent.md`, `tools/`, `skills/`, and `mcp.json` |
448
- | `AZURE_FUNCTIONS_AGENTS_CONFIG_DIR` | Override the directory used for session storage |
449
- | `AGENT_TIMEOUT` | Per-call timeout in seconds (default `900`) |
450
- | `MAF_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
451
- | `MAF_REASONING_EFFORT` | Reasoning effort for supported reasoning models (default `high`; valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
452
- | `MAF_REASONING_SUMMARY` | Reasoning summary mode for supported reasoning models (default `concise`; valid values are `auto`, `concise`, `detailed`) |
453
+ | `AZURE_FUNCTIONS_AGENTS_SESSION_DIR` | Override the directory used for local session storage |
454
+ | `AZURE_FUNCTIONS_AGENTS_TIMEOUT_SECONDS` | Per-call timeout in seconds (default `900`) |
455
+ | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
456
+ | `AZURE_FUNCTIONS_AGENTS_MODEL` | Runtime-owned model fallback when no provider-specific model/deployment is set |
457
+ | `AZURE_FUNCTIONS_AGENTS_REASONING_EFFORT` | Optional reasoning effort for supported reasoning models (valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
458
+ | `AZURE_FUNCTIONS_AGENTS_REASONING_SUMMARY` | Optional reasoning summary mode for supported reasoning models (valid values are `auto`, `concise`, `detailed`) |
453
459
 
454
460
  ## Development
455
461
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "azurefunctions-agents-runtime"
7
- version = "0.0.0dev6"
7
+ dynamic = ["version"]
8
8
  description = "A markdown-first programming model for building AI agents on Azure Functions, powered by the Microsoft Agent Framework."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -37,6 +37,9 @@ dev = [
37
37
  [tool.setuptools.packages.find]
38
38
  where = ["src"]
39
39
 
40
+ [tool.setuptools.dynamic]
41
+ version = {attr = "azure_functions_agents.__version__"}
42
+
40
43
  [tool.setuptools.package-data]
41
44
  azure_functions_agents = ["public/**"]
42
45