Files
ax_hub_mcp_tool/scratch/print_tools_json.py
jade e998127fa5
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 1m3s
feat: implement MCI session fetching using employee number
2026-08-19 16:41:13 +09:00

41 lines
1.1 KiB
Python

import yaml
import json
import glob
import sys
def main():
tools = []
# cmm 폴더의 yaml 파일들을 읽습니다.
files = glob.glob('dap-was-cus/src/main/resources/tool-definitions/cmm/*.yml')
if not files:
files = glob.glob('dap-was-sal/src/main/resources/tool-definitions/cmm/*.yml')
for f in files:
with open(f, 'r', encoding='utf-8') as file:
data = yaml.safe_load(file)
# MCP JSON Schema 규격에 맞게 변환
tool = {
"name": data.get("name"),
"description": data.get("description", {}).get("function", "") if isinstance(data.get("description"), dict) else data.get("description", ""),
"inputSchema": data.get("parameters_schema", {
"type": "object",
"properties": {}
})
}
tools.append(tool)
response = {
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": tools
}
}
print(json.dumps(response, indent=2, ensure_ascii=False))
if __name__ == '__main__':
main()