> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridger.kr/llms.txt
> Use this file to discover all available pages before exploring further.

# 첫 도구 호출

> MCP JSON-RPC로 Bridger에 등록된 도구를 처음 호출해 봅니다.

이 페이지는 Bridger Gateway에 연결한 직후 어떤 호출이 어떤 응답으로 돌아오는지를 보여 줍니다.
도구 한 개를 골라 입력 → 출력 흐름을 확인하면 그다음부터는 어떤 도구든 동일한 패턴으로
호출할 수 있습니다.

## 준비

* [API 키 발급](/guides/api-keys) 완료
* `DATA_BRIDGE_API_KEY` 환경변수에 키 저장

```bash theme={null}
export DATA_BRIDGE_API_KEY="dk_live_..."
```

## 1. 등록된 도구 목록 조회

`tools/list`는 Bridger에 로드된 **모든 MCP 도구의 메타데이터**를 반환합니다 (`name`, `description`,
`inputSchema`).

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://mcp.datari.kr/mcp \
    -H "x-api-key: $DATA_BRIDGE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://mcp.datari.kr/mcp", {
    method: "POST",
    headers: {
      "x-api-key": process.env.DATA_BRIDGE_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: 1,
      method: "tools/list",
    }),
  });
  console.log(await res.json());
  ```

  ```python Python theme={null}
  import os, requests
  r = requests.post(
      "https://mcp.datari.kr/mcp",
      headers={
          "x-api-key": os.environ["DATA_BRIDGE_API_KEY"],
          "Content-Type": "application/json",
      },
      json={"jsonrpc": "2.0", "id": 1, "method": "tools/list"},
  )
  print(r.json())
  ```
</CodeGroup>

응답에는 다음과 같은 구조의 도구가 포함됩니다.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "getultrashortcast",
        "description": "기상청 초단기예보 조회 — 공공데이터포털 OpenAPI",
        "inputSchema": {
          "type": "object",
          "properties": {
            "searchKeyword": { "type": "string", "description": "검색 키워드" },
            "pageNo": { "type": "integer", "description": "페이지 번호" },
            "numOfRows": { "type": "integer", "description": "한 페이지 결과 수" }
          }
        }
      }
    ]
  }
}
```

## 2. 도구 실행

도구 하나를 골라 `tools/call`로 실행합니다. 예시는 서울 강남구 초단기예보입니다.

```bash theme={null}
curl -X POST https://mcp.datari.kr/mcp \
  -H "x-api-key: $DATA_BRIDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "getultrashortcast",
      "arguments": {
        "searchKeyword": "서울",
        "numOfRows": 10
      }
    }
  }'
```

## 3. SSE로 실시간 이벤트 받기

장시간 실행 도구나 스트리밍 응답은 SSE 엔드포인트(`/mcp/sse`)로 받습니다.

```bash theme={null}
curl -N https://mcp.datari.kr/mcp/sse \
  -H "x-api-key: $DATA_BRIDGE_API_KEY"
```

`gateway/toolResult` 이벤트가 도구 실행마다 브로드캐스트됩니다.

## 다음 단계

<CardGroup cols={2}>
  <Card title="Claude에 연결" icon="comment" href="/guides/claude">
    위와 동일한 도구를 Claude가 자연어로 호출하도록 연결.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    JSON-RPC · SSE 전체 스펙과 에러 코드.
  </Card>
</CardGroup>
