Skip to content

Add OUTPUT_FORMAT=json support for structured output#1

Open
sam-at-luther wants to merge 2 commits intomainfrom
add-json-output-support
Open

Add OUTPUT_FORMAT=json support for structured output#1
sam-at-luther wants to merge 2 commits intomainfrom
add-json-output-support

Conversation

@sam-at-luther
Copy link
Member

This PR adds support for JSON output format to enable structured results instead of text/markdown output.

Changes

  • Add OUTPUT_FORMAT environment variable to config (defaults to 'text')
  • Update formatters to support JSON output mode
  • When OUTPUT_FORMAT=json, return structured JSON instead of text/markdown
  • Maintains backward compatibility with default text output
  • Similar to implementation in mcp-server-oracle

Usage

Set the environment variable:

OUTPUT_FORMAT=json

Example Output

Instead of:

📋 Available schemas in HANA database:

- SYSTEM
- MY_SCHEMA

Total schemas: 2

Returns:

{
  "schemas": ["SYSTEM", "MY_SCHEMA"],
  "total": 2
}

Testing

Tested with:

  • Schema listing
  • Table listing
  • Query execution
  • Table structure inspection

This feature is intended to be PRed upstream to the original repository.

- Add OUTPUT_FORMAT environment variable to config (defaults to 'text')
- Update formatters to support JSON output mode
- When OUTPUT_FORMAT=json, return structured JSON instead of text/markdown
- Maintains backward compatibility with default text output
- Similar to implementation in mcp-server-oracle
- Add OUTPUT_FORMAT environment variable to config (defaults to 'text')
- Update formatters to support JSON output mode
- When OUTPUT_FORMAT=json, return structured JSON instead of text/markdown
- Maintains backward compatibility with default text output
- Similar to implementation in mcp-server-oracle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant