Documentation
¶
Overview ¶
Package dunemcp calls tools on the Dune MCP server with the CLI's API key.
The CLI uses it for capabilities that the Dune MCP server offers and the REST API does not, so those commands behave exactly like the MCP tools.
Index ¶
Constants ¶
const Path = "/mcp/v1"
Path is where the Dune API host serves the MCP server.
Variables ¶
This section is empty.
Functions ¶
func Images ¶ added in v0.1.24
func Images(res *mcp.CallToolResult) [][]byte
Images returns the decoded data of the image blocks in a tool result.
func Result ¶
func Result(tool string, res *mcp.CallToolResult) (json.RawMessage, error)
Result returns the structured content of a tool result as JSON, or the error the tool reported. A result without structured content falls back to its first text block, which Dune tools fill with the same JSON.
Types ¶
type Caller ¶
type Caller interface {
// Call runs a tool and returns its structured result as JSON.
Call(ctx context.Context, tool string, args map[string]any) (json.RawMessage, error)
// CallWithImages runs a tool like Call and also returns the images in its
// result, decoded.
CallWithImages(ctx context.Context, tool string, args map[string]any) (json.RawMessage, [][]byte, error)
}
Caller calls tools on the Dune MCP server.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Caller that opens one MCP session per call.
func New ¶
New returns a Client for the Dune API at host. The API key and headers are sent on every request.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dunemcptest provides a fake Dune MCP server for command tests.
|
Package dunemcptest provides a fake Dune MCP server for command tests. |