Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 116 additions & 1 deletion agentschema-emitter/lib/model/manifest.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ model AgentManifest {
resources: Resources;
}

alias ResourceKind = "model" | "tool";
alias ResourceKind = "model" | "tool" | "toolbox";
/**
* Represents a resource required by the agent
* Resources can include databases, APIs, or other external systems
Expand Down Expand Up @@ -139,3 +139,118 @@ alias Resources = Record<Resource> | Named<
"Name of the resource",
#{ name: "my-resource" }
>[];

@doc("Known toolbox tool type identifiers")
union ToolboxToolTypes {
@doc("Model Context Protocol server")
mcp: "mcp",

@doc("Web search via Bing grounding")
web_search: "web_search",

@doc("Azure AI Search index")
azure_ai_search: "azure_ai_search",

@doc("OpenAPI specification endpoint")
openapi: "openapi",

@doc("Agent-to-agent delegation (preview)")
a2a_preview: "a2a_preview",

@doc("Sandboxed Python code execution")
code_interpreter: "code_interpreter",

@doc("Vector store file search")
file_search: "file_search",

string,
}

@doc("Authentication types for toolbox tool connections")
union ToolboxAuthTypes {
@doc("Custom API key or PAT-based authentication")
CustomKeys: "CustomKeys",

@doc("OAuth 2.0 with identity passthrough")
OAuth2: "OAuth2",

@doc("Microsoft Entra ID user token")
UserEntraToken: "UserEntraToken",

@doc("Foundry project managed identity")
ProjectManagedIdentity: "ProjectManagedIdentity",

@doc("Agentic identity token (preview)")
AgenticIdentityToken: "AgenticIdentityToken",

string,
}

/**
* Represents a tool definition within a toolbox.
* Tools can be Foundry-hosted (web_search, azure_ai_search, etc.)
* or external (mcp, openapi, a2a_preview) with connection details.
*/
model ToolboxTool {
@doc("The tool type identifier (e.g., 'web_search', 'azure_ai_search', 'mcp', 'a2a_preview')")
@sample(#{ id: "web_search" })
id: ToolboxToolTypes;

@doc("Optional display name for the tool")
@sample(#{ name: "my-search-tool" })
name?: string;

@doc("Human-readable description of the tool's capabilities")
@sample(#{ description: "Searches the web for up-to-date information" })
description?: string;

@doc("Target endpoint URL for external tools (e.g., MCP server URL, A2A agent URL)")
@sample(#{ target: "https://api.githubcopilot.com/mcp" })
target?: string;

@doc("Authentication type for the tool connection")
@sample(#{ authType: "OAuth2" })
authType?: ToolboxAuthTypes;

@doc("Additional configuration options for the tool")
@sample(#{ options: #{ indexName: "products-index" } })
options?: Record<unknown> = #{};
}

/**
* Represents a Foundry Toolbox resource — a named collection of tools
* that is provisioned as a Foundry Toolbox and exposed via MCP endpoint.
*/
model ToolboxResource extends Resource {
@doc("The kind identifier for toolbox resources")
@sample(#{ kind: "toolbox" })
kind: "toolbox";

@doc("Description of the toolbox")
@sample(#{ description: "Shared platform tools" })
description?: string;

@doc("The tools contained in this toolbox")
@sample(#{
tools: #[
#{ id: "web_search" },
#{
id: "azure_ai_search",
options: #{ indexName: "products-index" },
},
#{
id: "mcp",
name: "github-copilot",
target: "https://api.githubcopilot.com/mcp",
authType: "OAuth2",
},
#{
id: "a2a_preview",
name: "research-agent",
description: "Delegates research tasks to a specialized agent",
target: "https://research-agent.example.com",
}
],
})
tools: ToolboxTool[];
}
4 changes: 2 additions & 2 deletions agentschema-emitter/src/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ const renderCSharp = (nodes: TypeNode[], node: TypeNode, classTemplate: nunjucks
let hasNameProperty = false;

if (itemType) {
// Check if item type has a 'name' property (supports object format)
hasNameProperty = itemType.properties.some(prop => prop.name === "name");
// Check if item type has a required 'name' property (supports object format)
hasNameProperty = itemType.properties.some(prop => prop.name === "name" && !prop.isOptional);

if (itemType.alternates && itemType.alternates.length > 0) {
const firstAlt = itemType.alternates[0];
Expand Down
2 changes: 1 addition & 1 deletion agentschema-emitter/src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function getCollectionTypes(node: TypeNode): Array<{ prop: PropertyNode; type: s
.map((p) => ({
prop: p,
type: p.type?.properties.filter((t) => t.name !== "name").map((t) => t.name) || [],
hasNameProperty: p.type?.properties.some((t) => t.name === "name") || false,
hasNameProperty: p.type?.properties.some((t) => t.name === "name" && !t.isOptional) || false,
}));
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/reference/AgentManifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ resources:
| metadata | dictionary | Additional metadata including authors, tags, and other arbitrary properties |
| template | [AgentDefinition](../agentdefinition/) | The agent that this manifest is based on(Related Types: [PromptAgent](../promptagent/), [Workflow](../workflow/), [ContainerAgent](../containeragent/)) |
| parameters | [PropertySchema](../propertyschema/) | Parameters for configuring the agent&#39;s behavior and execution |
| resources | [Resource[]](../resource/) | Resources required by the agent, such as models or tools(Related Types: [ModelResource](../modelresource/), [ToolResource](../toolresource/)) |
| resources | [Resource[]](../resource/) | Resources required by the agent, such as models or tools(Related Types: [ModelResource](../modelresource/), [ToolResource](../toolresource/), [ToolboxResource](../toolboxresource/)) |

## Composed Types

Expand Down
17 changes: 17 additions & 0 deletions docs/src/content/docs/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,21 @@ classDiagram
+string id
+dictionary options
}
class ToolboxTool {

+string id
+string name
+string description
+string target
+string authType
+dictionary options
}
class ToolboxResource {

+string kind
+string description
+ToolboxTool[] tools
}
class AgentManifest {

+string name
Expand Down Expand Up @@ -302,6 +317,7 @@ classDiagram
McpServerApprovalMode <|-- McpServerToolSpecifyApprovalMode
Resource <|-- ModelResource
Resource <|-- ToolResource
Resource <|-- ToolboxResource
AgentDefinition *-- PropertySchema
AgentDefinition *-- PropertySchema
Model *-- Connection
Expand All @@ -326,6 +342,7 @@ classDiagram
ContainerAgent *-- ProtocolVersionRecord
ContainerAgent *-- ContainerResources
ContainerAgent *-- EnvironmentVariable
ToolboxResource *-- ToolboxTool
AgentManifest *-- AgentDefinition
AgentManifest *-- PropertySchema
AgentManifest *-- Resource
Expand Down
7 changes: 7 additions & 0 deletions docs/src/content/docs/reference/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ classDiagram
+dictionary options
}
Resource <|-- ToolResource
class ToolboxResource {
+string kind
+string description
+ToolboxTool[] tools
}
Resource <|-- ToolboxResource
```

## Yaml Example
Expand All @@ -58,3 +64,4 @@ The following types extend `Resource`:

- [ModelResource](../modelresource/)
- [ToolResource](../toolresource/)
- [ToolboxResource](../toolboxresource/)
76 changes: 76 additions & 0 deletions docs/src/content/docs/reference/ToolboxResource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "ToolboxResource"
description: "Documentation for the ToolboxResource type."
slug: "reference/toolboxresource"
---

Represents a Foundry Toolbox resource — a named collection of tools
that is provisioned as a Foundry Toolbox and exposed via MCP endpoint.

## Class Diagram

```mermaid
---
title: ToolboxResource
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class Resource {
+string name
+string kind
}
Resource <|-- ToolboxResource
class ToolboxResource {

+string kind
+string description
+ToolboxTool[] tools
}
class ToolboxTool {
+string id
+string name
+string description
+string target
+string authType
+dictionary options
}
ToolboxResource *-- ToolboxTool
```

## Yaml Example

```yaml
kind: toolbox
description: Shared platform tools
tools:
- id: web_search
- id: azure_ai_search
options:
indexName: products-index
- id: mcp
name: github-copilot
target: https://api.githubcopilot.com/mcp
authType: OAuth2
- id: a2a_preview
name: research-agent
description: Delegates research tasks to a specialized agent
target: https://research-agent.example.com
```

## Properties

| Name | Type | Description |
| ---- | ---- | ----------- |
| kind | string | The kind identifier for toolbox resources |
| description | string | Description of the toolbox |
| tools | [ToolboxTool[]](../toolboxtool/) | The tools contained in this toolbox |

## Composed Types

The following types are composed within `ToolboxResource`:

- [ToolboxTool](../toolboxtool/)
55 changes: 55 additions & 0 deletions docs/src/content/docs/reference/ToolboxTool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: "ToolboxTool"
description: "Documentation for the ToolboxTool type."
slug: "reference/toolboxtool"
---

Represents a tool definition within a toolbox.
Tools can be Foundry-hosted (web_search, azure_ai_search, etc.)
or external (mcp, openapi, a2a_preview) with connection details.

## Class Diagram

```mermaid
---
title: ToolboxTool
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class ToolboxTool {

+string id
+string name
+string description
+string target
+string authType
+dictionary options
}
```

## Yaml Example

```yaml
id: web_search
name: my-search-tool
description: Searches the web for up-to-date information
target: https://api.githubcopilot.com/mcp
authType: OAuth2
options:
indexName: products-index
```

## Properties

| Name | Type | Description |
| ---- | ---- | ----------- |
| id | string | The tool type identifier (e.g., &#39;web_search&#39;, &#39;azure_ai_search&#39;, &#39;mcp&#39;, &#39;a2a_preview&#39;) |
| name | string | Optional display name for the tool |
| description | string | Human-readable description of the tool&#39;s capabilities |
| target | string | Target endpoint URL for external tools (e.g., MCP server URL, A2A agent URL) |
| authType | string | Authentication type for the tool connection |
| options | dictionary | Additional configuration options for the tool |
Loading
Loading