Skip to content

Return structured empty YAML document when no data is available #373

@onmete

Description

@onmete

Description

Currently, mcp server may return an empty string when there are no matching resources for the given arguments. While this is technically a valid outcome, it can make it difficult for downstream consumers (e.g., the LLM) to distinguish between “no results” and an unexpected error or missing data.

Expected Behavior

When there are no results, openshift-mcp should return an empty YAML document that clearly indicates the absence of matching resources while preserving structured output.

Example output with no data

Image

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