Skip to content

Variable: tools

@providerprotocol/ai


@providerprotocol/ai / moonshot / tools

const tools: object

Defined in: src/providers/moonshot/types.ts:700

Moonshot builtin tools factory object. Provides convenient access to all builtin tool creators.

Note: The excel plugin tool uses a different format and is not included here. It requires file IDs from the Moonshot file upload API.

base64: () => MoonshotTool = base64Encode

Alias for base64Encode

Creates a Base64 encoding tool (server-side execution).

MoonshotTool

base64Decode: () => MoonshotTool

Base64 decoding

Creates a Base64 decoding tool (server-side execution).

MoonshotTool

base64Encode: () => MoonshotTool

Base64 encoding

Creates a Base64 encoding tool (server-side execution).

MoonshotTool

codeRunner: () => MoonshotTool

Python code execution with matplotlib, pandas support

Creates a Python code runner tool (server-side execution). Allows execution of Python code for calculations and data processing. Supports print output, matplotlib plots, pandas, and file reading via ctx.read_object().

MoonshotTool

convert: () => MoonshotTool

Unit conversion (length, mass, temperature, currency, etc.)

Creates a unit conversion tool (server-side execution). Supports length, mass, volume, temperature, area, time, energy, pressure, speed, and currency conversions.

MoonshotTool

date: () => MoonshotTool

Date/time processing and timezone conversion

Creates a date/time processing tool (server-side execution). Handles date and time calculations, timezone conversion, and formatting.

MoonshotTool

fetch: () => MoonshotTool

URL content fetching with markdown extraction

Creates a URL fetch tool (server-side execution). Extracts content from URLs and formats it as Markdown.

MoonshotTool

memory: () => MoonshotTool

Memory storage and retrieval system

Creates a memory storage tool (server-side execution). Supports persistent storage of conversation history and user preferences.

MoonshotTool

mew: () => MoonshotTool

Cat meowing and blessings generator

Creates a cat meowing/blessing tool (server-side execution). Returns random cat meowing sounds and blessings based on mood.

MoonshotTool

quickjs: () => MoonshotTool

JavaScript execution via QuickJS engine

Creates a QuickJS JavaScript execution tool (server-side execution). Enables secure JavaScript code execution via the QuickJS engine.

MoonshotTool

randomChoice: () => MoonshotTool

Random selection with optional weights

Creates a random choice tool (server-side execution). Enables random selection from options with optional weights.

MoonshotTool

rethink: () => MoonshotTool

Intelligent reasoning/reflection tool

Creates an intelligent reasoning tool (server-side execution). Allows the model to organize thoughts and plan before responding.

MoonshotTool

webSearch: () => MoonshotTool

Web search for real-time internet information

Creates a web search tool (server-side execution). Enables real-time internet search capabilities.

Note: Web search is charged separately from regular API usage.

MoonshotTool

import { moonshot, tools } from '@providerprotocol/ai/moonshot';
const model = llm({
model: moonshot('kimi-k2.5'),
params: {
tools: [tools.webSearch()],
},
});
import { moonshot, tools } from '@providerprotocol/ai/moonshot';
const model = llm({
model: moonshot('kimi-k2.5'),
params: {
tools: [
tools.webSearch(),
tools.codeRunner(),
tools.fetch(),
],
},
});