47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/*
|
|
* agent_tool_catalog.h — shared tool catalog definitions
|
|
*
|
|
* Exposes the tool_defs[] array, its count, and build_tools_list()
|
|
* so that both the MCP server (agent_mcp.c) and the embedded agent
|
|
* (agent_llm.c, future) can access the same tool catalog.
|
|
*
|
|
* The definitions live in agent_mcp.c; this header just makes them
|
|
* non-static and declares them here.
|
|
*/
|
|
|
|
#ifndef AGENT_TOOL_CATALOG_H
|
|
#define AGENT_TOOL_CATALOG_H
|
|
|
|
#include "cjson/cJSON.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* ── Tool definition struct ────────────────────────────────────────── *
|
|
* Each entry has a name, human-readable description, and a pre-built
|
|
* JSON Schema string for the tool's input parameters.
|
|
*/
|
|
typedef struct {
|
|
const char *name;
|
|
const char *description;
|
|
const char *schema_json; /* pre-built JSON schema string */
|
|
} mcp_tool_def_t;
|
|
|
|
/* The shared tool catalog array and its length. */
|
|
extern const mcp_tool_def_t tool_defs[];
|
|
extern const int tool_defs_count;
|
|
|
|
/*
|
|
* Build a cJSON array of tool definitions in the MCP tools/list format:
|
|
* [{"name":"...","description":"...","inputSchema":{...}}, ...]
|
|
* The caller frees the returned cJSON*.
|
|
*/
|
|
cJSON *build_tools_list(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* AGENT_TOOL_CATALOG_H */
|