real tools across 82 categories via Cohere's tool_use API. Define tools as ToolDefinition objects with the cohere Python SDK — Slopshop handles all execution.
Free persistent memory. Every result verified.
Cohere's tool_use format uses ToolDefinition with ToolParameterDefinitionsValue. It's distinct from OpenAI's format — but Slopshop's schema converts cleanly.
Use Cohere's official Python SDK. The cohere package gives you access to Command R+ with native tool_use support.
Fetch Slopshop's OpenAPI schema and convert each endpoint to Cohere's ToolDefinition format with parameter definitions.
When finish_reason="TOOL_CALL", execute each tool_call via Slopshop and pass results back as ToolResult objects.
Full agentic loop using the cohere SDK. Cohere's tool_use has a distinct API — tool calls arrive as tool_calls[] and results go back as ToolResult objects in a tool_results turn.
import os, json, requests import cohere from cohere.types import ( ToolDefinition, ToolParameterDefinitionsValue, ToolResult, ToolCall ) co = cohere.Client(api_key=os.environ["COHERE_API_KEY"]) SLOP_KEY = os.environ["SLOPSHOP_API_KEY"] SLOP_URL = "https://slopshop.gg" # 1. Convert Slopshop OpenAPI schema to Cohere ToolDefinitions def get_tools(slugs: list[str]) -> list[ToolDefinition]: schema = requests.get( f"{SLOP_URL}/v1/openapi.json", headers={"Authorization": f"Bearer {SLOP_KEY}"} ).json() tools = [] for slug in slugs: path = schema["paths"].get(f"/v1/{slug}", {}).get("post", {}) if not path: continue params_schema = path["requestBody"]["content"]["application/json"]["schema"] props = params_schema.get("properties", {}) required = params_schema.get("required", []) # Build Cohere-style parameter definitions param_defs = {} for prop_name, prop_schema in props.items(): param_defs[prop_name] = ToolParameterDefinitionsValue( description=prop_schema.get("description", ""), type=prop_schema.get("type", "str"), required=prop_name in required ) tools.append(ToolDefinition( name=slug, description=path.get("summary", ""), parameter_definitions=param_defs )) return tools # 2. Execute a Slopshop tool def call_tool(name: str, args: dict) -> dict: res = requests.post( f"{SLOP_URL}/v1/{name}", json=args, headers={"Authorization": f"Bearer {SLOP_KEY}"} ) return res.json() # 3. Agentic loop — Cohere decides, Slopshop executes def run_agent(user_message: str) -> str: tools = get_tools(["dns-lookup", "ssl-check", "http-request", "whois", "hash", "memory-set", "memory-get"]) # First turn: user message response = co.chat( model="command-r-plus", message=user_message, tools=tools ) while response.finish_reason == "TOOL_CALL": tool_results = [] for tc in response.tool_calls: result = call_tool(tc.name, tc.parameters) tool_results.append(ToolResult( call=tc, outputs=[result] )) # Send tool results back to Cohere response = co.chat( model="command-r-plus", chat_history=response.chat_history, message="", tools=tools, tool_results=tool_results ) return response.text answer = run_agent("Audit slopshop.gg: check DNS records, SSL validity, and save results to memory") print(answer)
{
"name": "dns-lookup",
"parameters": {
"host": "slopshop.gg",
"type": "A"
},
"generation_id": "gen_abc"
}{
"records": ["76.76.21.21"],
"ttl": 300,
"type": "A",
"_engine": "real"
}Cohere's Command models excel at RAG and enterprise tasks. Slopshop gives them the execution layer — real tools across 82 categories, all verified.
DNS, SSL, HTTP, crypto, hashing, code execution, data transforms, document generation. All real. No hallucinated outputs.
Command agents can write to and read from Slopshop's key-value store at zero credit cost. State persists across chat sessions.
Slopshop schemas convert directly to Cohere's ToolDefinition / ToolParameterDefinitionsValue format. No raw dict wrangling.
Audit logs, per-request tracing, credit usage per tool call. Every invocation logged with inputs, outputs, and latency.
Run the entire Slopshop tool server on your own infrastructure. Zero external dependencies for compute APIs.