@sharelyai/tools
v0.0.4
Published
Sharely tool definitions.
Readme
@sharelyai/tools
First-party Sharely tool definitions — the LLM-facing contracts for the 7 platform tools (search_knowledge, semantic_search, get_knowledge_item, list_taxonomies, get_taxonomy_knowledge, get_workspace_stats, list_roles).
The same definition objects are consumed by sharelyai-be's hosted agent runtime, so the JSON schema your LLM sees is identical whether the agent runs Sharely-hosted, Vercel AI–driven, or as a raw Handler.
Install
npm i @sharelyai/tools @sharelyai/protocolWhat's shipped
definitions— typedToolDefinition[]for all 7 tools.- Per-tool exports:
searchKnowledgeDefinition,semanticSearchDefinition,getKnowledgeItemDefinition,listTaxonomiesDefinition,getTaxonomyKnowledgeDefinition,getWorkspaceStatsDefinition,listRolesDefinition. getToolDefinitions()/getDefinitionByName(name)— lookup helpers.createTools(executors)— produces aTool[]for an executor registry you supply. Tools without a registered executor return{ error: "Tool ... has no executor wired" }.createPlatformExecutors(api)— platform-backed executors for the tools that have a Backplane endpoint today. Currentlysemantic_search, backed by@sharelyai/api'srag().executeTool(name, input, ctx, executors)— dispatches by name.
The execute layer
The upstream sharelyai-be execute functions hit Prisma / Pinecone / OpenAI embeddings directly — those can't ship in a public SDK. Instead:
semantic_searchworks out of the box —createPlatformExecutors(api)backs it with@sharelyai/api'srag()(embedding + vector retrieval).- The other 6 tools (
search_knowledge,get_knowledge_item,list_taxonomies,get_taxonomy_knowledge,get_workspace_stats,list_roles) have no Backplane endpoint yet — plug your own executor.search_knowledgein particular is keyword/ILIKE search and is not backed byrag()(that would silently turn a keyword tool into semantic search).
import { createTools, createPlatformExecutors } from '@sharelyai/tools';
const tools = createTools({
...createPlatformExecutors(api), // semantic_search, ready to use
search_knowledge: async (input, ctx) => {
// bring your own
return { output: { totalResults: 0, results: [] } };
},
});