Substitui barras de caixa (─ ═ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴), travessões (—), setas (→ ←), reticências (…), bullets (•), multiplicação (×) e guillemets (› ‹) por equivalentes ASCII. Acentos portugueses são preservados.
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
#ifndef TINYBLOCKS_MCP_H
|
|
#define TINYBLOCKS_MCP_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#ifdef _WIN32
|
|
# define TB_MCP_API __declspec(dllexport)
|
|
#else
|
|
# define TB_MCP_API __attribute__((visibility("default")))
|
|
#endif
|
|
|
|
/*
|
|
* tb_mcp - cliente MCP (Model Context Protocol) sobre transporte HTTP
|
|
* e stdio, implementado em Python via tinyblocks-python.
|
|
*
|
|
* Transport HTTP (streamable): url = "http://host:port/mcp"
|
|
* Transport stdio: url = "stdio://npx @modelcontextprotocol/server-filesystem /tmp"
|
|
*
|
|
* Todas as funções retornam string heap-alocada (caller frees) ou NULL em erro.
|
|
*/
|
|
|
|
TB_MCP_API bool tb_mcp_init(void);
|
|
TB_MCP_API void tb_mcp_deinit(void);
|
|
|
|
/* Lista ferramentas disponíveis -> JSON array de objetos {name, description} */
|
|
TB_MCP_API char* tb_mcp_list_tools(const char* url);
|
|
|
|
/* Chama uma ferramenta com argumentos JSON -> resultado JSON */
|
|
TB_MCP_API char* tb_mcp_call_tool(const char* url,
|
|
const char* tool_name,
|
|
const char* args_json);
|
|
|
|
/* Ping: verifica se o servidor responde -> "ok" ou mensagem de erro */
|
|
TB_MCP_API char* tb_mcp_ping(const char* url);
|
|
|
|
#endif /* TINYBLOCKS_MCP_H */
|