Skip to content

Hosted agent samples are missing schema definition and missing properties to validate against AgentManifest.yaml schema #522

@therealjohn

Description

@therealjohn

The sample agent.yaml files are https://github.com/microsoft/AgentSchema/blob/main/schemas/v1.0/AgentManifest.yaml but it's hard to know that without reference to the schema.

i.e. https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/agent-framework/agent-with-foundry-tools/agent.yaml
Existing:

# Unique identifier/name for this agent
name: af-agent-with-foundry-tools
# Brief description of what this agent does
description: >
  An AI agent that uses Azure OpenAI with a Hosted Model Context Protocol (MCP) server.
  The agent answers questions by searching Microsoft Learn documentation using MCP tools.
metadata:
  # Categorization tags for organizing and discovering agents
  authors:
    - Microsoft
  tags:
    - Azure AI AgentServer
    - Microsoft Agent Framework
    - Model Context Protocol
    - MCP
template:
  name: af-agent-with-foundry-tools
  kind: hosted
  protocols:
    - protocol: responses
  environment_variables:
    - name: AZURE_OPENAI_ENDPOINT
      value: ${AZURE_OPENAI_ENDPOINT}
    - name: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME
      value: "{{chat}}"
    - name: AZURE_AI_PROJECT_TOOL_CONNECTION_ID
      value: <CONNECTION_ID_PLACEHOLDER>
resources:
  - kind: model
    id: gpt-5
    name: chat

To improve this:

  1. Add # yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/AgentSchema/refs/heads/main/schemas/v1.0/AgentManifest.yaml to the top of the file.
  2. Add missing properties so it validates correctly against the schemas required properties: displayName, parameters.

After changes:

# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/AgentSchema/refs/heads/main/schemas/v1.0/AgentManifest.yaml

# Unique identifier/name for this agent
name: seattle-hotel-agent
# Display name for this agent
displayName: Seattle Hotel Agent
# Brief description of what this agent does
description: >
  A travel assistant agent that helps users find hotels in Seattle.
  Demonstrates local Python tool execution - a key advantage of code-based 
  hosted agents over prompt agents.
metadata:
  # Categorization tags for organizing and discovering agents
  authors:
    - Microsoft
  tags:
    - Azure AI AgentServer
    - Microsoft Agent Framework
    - Local Tools
    - Travel Assistant
    - Hotel Search
parameters:
  properties: {}
template:
  name: seattle-hotel-agent
  kind: hosted
  protocols:
    - protocol: responses
  environment_variables:
    - name: PROJECT_ENDPOINT
      value: ${AZURE_AI_PROJECT_ENDPOINT}
    - name: MODEL_DEPLOYMENT_NAME
      value: "{{chat}}"
resources:
  - kind: model
    id: gpt-4.1-mini
    name: chat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions