ElGraph.MCP.Tool (ElGraph v0.3.0)

Copy Markdown View Source

MCP 서버에서 가져온 툴 (SPEC §4: MCP 툴 → Action 자동 변환).

to_tool_spec/1ElGraph.Action.to_tool_spec/1과 같은 형태를 반환하므로 LLM tool-calling 루프에서 Action과 MCP 툴을 구분 없이 섞어 쓸 수 있다.

Summary

Functions

클라이언트를 통해 MCP 서버의 툴을 호출한다.

Action과 동일한 형태의 LLM tool 스펙을 반환한다.

Types

t()

@type t() :: %ElGraph.MCP.Tool{
  client: ElGraph.MCP.Client.client(),
  client_mod: module(),
  description: String.t() | nil,
  input_schema: map(),
  name: String.t()
}

Functions

execute(tool, params, ctx)

@spec execute(t(), map(), term()) :: {:ok, term()} | {:error, term()}

클라이언트를 통해 MCP 서버의 툴을 호출한다.

to_tool_spec(tool)

@spec to_tool_spec(t()) :: %{
  name: String.t(),
  description: String.t() | nil,
  input_schema: map()
}

Action과 동일한 형태의 LLM tool 스펙을 반환한다.