[PR #59] [MERGED] [feat] Added nested object schema support. #149

Closed
opened 2026-02-15 21:15:08 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/mcpo/pull/59
Author: @bmen25124
Created: 4/9/2025
Status: Merged
Merged: 4/9/2025
Merged by: @tjbck

Base: devHead: handle_object_array_nested_types


📝 Commits (2)

  • 9cbfcd4 Resolve "object" and "array" types
  • 637dc48 Updated dev dependencies

📊 Changes

5 files changed (+357 additions, -26 deletions)

View changed files

📝 README.md (+20 -0)
📝 pyproject.toml (+5 -0)
📝 src/mcpo/main.py (+80 -26)
tests/test_main.py (+201 -0)
📝 uv.lock (+51 -0)

📄 Description

Changelog Entry

Added nested object schema support.

Description

Example schema from source code

{
    "name": "create_entities",
    "description": "Create multiple new entities in the knowledge graph",
    "inputSchema": {
        "type": "object",
        "properties": {
            "entities": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string",
                            "description": "The name of the entity"
                        },
                        "entityType": {
                            "type": "string",
                            "description": "The type of the entity"
                        },
                        "observations": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "description": "An array of observation contents associated with the entity"
                        }
                    },
                    "required": [
                        "name",
                        "entityType",
                        "observations"
                    ]
                }
            }
        },
        "required": [
            "entities"
        ]
    }
}

This is what mcp0 converts:

paths:
  /create_entities:
    post:
      summary: Create Entities
      description: Create multiple new entities in the knowledge graph
      operationId: tool_create_entities_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_entities_form_model'
        required: true
#...
#...

    create_entities_form_model:
      properties:
        entities:
          items: {}
          type: array
          title: Entities
          description: ''
      type: object
      required:
        - entities
      title: create_entities_form_model

I was going to create an issue for this, however, I solved the issue myself.


Additional Information

I added unit tests for this. Feel free to run it to make sure it's working.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/mcpo/pull/59 **Author:** [@bmen25124](https://github.com/bmen25124) **Created:** 4/9/2025 **Status:** ✅ Merged **Merged:** 4/9/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `handle_object_array_nested_types` --- ### 📝 Commits (2) - [`9cbfcd4`](https://github.com/open-webui/mcpo/commit/9cbfcd49b9ce0a98f5d4133d1b95fe8ea012faba) Resolve "object" and "array" types - [`637dc48`](https://github.com/open-webui/mcpo/commit/637dc48281b59d1a8190160bc86fedbc31ad31c4) Updated dev dependencies ### 📊 Changes **5 files changed** (+357 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+20 -0) 📝 `pyproject.toml` (+5 -0) 📝 `src/mcpo/main.py` (+80 -26) ➕ `tests/test_main.py` (+201 -0) 📝 `uv.lock` (+51 -0) </details> ### 📄 Description # Changelog Entry Added nested object schema support. ### Description Example schema from [source code](https://github.com/docker/mcp-servers/blob/6f7c7f069e7d44991ab205ea3fad221f746d2dd5/src/memory/index.ts#L202) ```json { "name": "create_entities", "description": "Create multiple new entities in the knowledge graph", "inputSchema": { "type": "object", "properties": { "entities": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the entity" }, "entityType": { "type": "string", "description": "The type of the entity" }, "observations": { "type": "array", "items": { "type": "string" }, "description": "An array of observation contents associated with the entity" } }, "required": [ "name", "entityType", "observations" ] } } }, "required": [ "entities" ] } } ``` This is what _mcp0_ converts: ```yaml paths: /create_entities: post: summary: Create Entities description: Create multiple new entities in the knowledge graph operationId: tool_create_entities_post requestBody: content: application/json: schema: $ref: '#/components/schemas/create_entities_form_model' required: true #... #... create_entities_form_model: properties: entities: items: {} type: array title: Entities description: '' type: object required: - entities title: create_entities_form_model ``` I was going to create an issue for this, however, I solved the issue myself. --- ### Additional Information I added unit tests for this. Feel free to run it to make sure it's working. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:15:08 -05:00
yindo closed this issue 2026-02-15 21:15:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/mcpo#149