본문으로 건너뛰기

빠른 시작

이 quickstart는 가장 작은 유용한 loop를 보여줍니다.

  1. package 설치
  2. OpenAPI spec 검색
  3. Python에서 graph build
  4. collection readiness 점검
  5. 안전한 경우 간단한 operation 실행

설치​

pip install graph-tool-call

필요한 extra만 골라 설치할 수 있습니다.

pip install "graph-tool-call[openapi]"
pip install "graph-tool-call[korean]"
pip install "graph-tool-call[mcp]"
pip install "graph-tool-call[all]"

차이부터 확인하기​

Target tool만 찾는 것으로 충분하지 않은 이유를 offline demo로 확인합니다. 실제 retriever, target selector, typed dependency closure를 사용합니다.

uvx graph-tool-call demo dependency-chain
Selected target:
refundOrder(order_id)

Required producer:
findOrdersByEmail(email) -> order_id

Execution order:
1. findOrdersByEmail
2. refundOrder

OpenAPI Spec 검색​

빠른 smoke test에는 CLI를 사용하고, application이나 test suite에 연결할 때는 Python API를 사용합니다.

uvx graph-tool-call search "create a new pet" \
--source https://petstore.swagger.io/v2/swagger.json \
--top-k 5 \
--scores

CLI는 source를 로드하고 임시 graph를 만든 뒤 candidate를 검색해 가장 강한 match를 출력합니다. 코드를 작성하기 전에 spec을 빠르게 점검할 때 사용합니다.

Tool Graph 빌드​

반복 검색에서 매번 source를 ingest하지 않으려면 reusable graph를 만듭니다.

from graph_tool_call import ToolGraph

graph = ToolGraph.from_url(
"https://petstore3.swagger.io/api/v3/openapi.json",
cache="petstore.graph.json",
)

results = graph.retrieve("create a new pet", top_k=5)
for tool in results:
print(tool.name)

local agent 실험에는 saved graph를 사용합니다. product adapter나 UI가 readiness, semantic, edge-quality metadata를 저장해야 한다면 collection artifact를 사용합니다.

API Collection 점검​

graph-tool-call inspect-openapi ./openapi.json --json

대형 OpenAPI collection을 agent에 연결하기 전에 실행하세요. 리포트는 schema coverage, contract coverage, graph readiness, semantic quality, 안정적인 issue code를 보여줍니다.

주로 확인할 field는 다음입니다.

Field중요한 이유
readiness_scorecollection readiness 요약
statusready, warning, blocked
issues[].coderepair를 위한 안정 reason code
semantic_summaryaction/resource/module coverage
edge_quality_summarygraph edge evidence 품질

Plan과 실행​

result = graph.execute(
"addPet",
{"name": "Buddy", "status": "available"},
base_url="https://petstore3.swagger.io/api/v3",
)

실행 metadata는 OpenAPI contract에서 파생됩니다. path/query/header/body 위치, content type, security requirement, response shape를 사용합니다.

auth readiness, required input, cleanup policy가 adapter에서 설정되기 전에는 production-like 환경에서 mutating API를 실행하지 않습니다.

다음 단계​