KEMBAR78
fix mcp client schema creation in flat lists by slopp · Pull Request #346 · NVIDIA/NeMo-Agent-Toolkit · GitHub
Skip to content

Conversation

@slopp
Copy link
Contributor

@slopp slopp commented Jun 6, 2025

Description

For MCP tools that have an input that is a flat list, eg

{
  'items': ['item', 'item']
}

The original code led to an invalid pydantic schema like this:

{
    'items': {'items': {}, 'type': 'array'},
    'type': 'array'
}

Now the schema is correctly created like this:

{
    'items': {'type': 'string'},
    'type': 'array'
}

Confirmed the fix using a JIRA MCP tool.

Closes #342

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jun 6, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@slopp slopp marked this pull request as draft June 6, 2025 14:56
@mdemoret-nv mdemoret-nv added bug Something isn't working non-breaking Non-breaking change labels Jun 6, 2025
@slopp slopp marked this pull request as ready for review June 6, 2025 16:12
slopp added 2 commits June 6, 2025 10:16
Signed-off-by: Sean Lopp <slopp@nvidia.com>
Signed-off-by: Sean Lopp <slopp@nvidia.com>
@AnuradhaKaruppiah
Copy link
Contributor

/ok to test 96cbad1

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
@AnuradhaKaruppiah
Copy link
Contributor

/ok to test 45d245f

@AnuradhaKaruppiah
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 7279fdc into NVIDIA:develop Jun 6, 2025
12 checks passed
AnuradhaKaruppiah pushed a commit to AnuradhaKaruppiah/oss-agentiq that referenced this pull request Aug 4, 2025
For MCP tools that have an input that is a flat list, eg 

```
{
  'items': ['item', 'item']
}
```

The original code led to an invalid pydantic schema like this: 

```
{
    'items': {'items': {}, 'type': 'array'},
    'type': 'array'
}
```

Now the schema is correctly created like this:

```
{
    'items': {'type': 'string'},
    'type': 'array'
}
```

Confirmed the fix using a JIRA MCP tool.

Closes NVIDIA#342 

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md).
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  - Any contribution which contains commits that are not Signed-Off will not be accepted.
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Sean Lopp (https://github.com/slopp)
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

Approvers:
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

URL: NVIDIA#346
scheckerNV pushed a commit to scheckerNV/aiq-factory-reset that referenced this pull request Aug 22, 2025
For MCP tools that have an input that is a flat list, eg 

```
{
  'items': ['item', 'item']
}
```

The original code led to an invalid pydantic schema like this: 

```
{
    'items': {'items': {}, 'type': 'array'},
    'type': 'array'
}
```

Now the schema is correctly created like this:

```
{
    'items': {'type': 'string'},
    'type': 'array'
}
```

Confirmed the fix using a JIRA MCP tool.

Closes NVIDIA#342 

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md).
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  - Any contribution which contains commits that are not Signed-Off will not be accepted.
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Sean Lopp (https://github.com/slopp)
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

Approvers:
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

URL: NVIDIA#346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Incorrect Schema creation for MCP Wrapped Tools

3 participants