Skip to content
tnsaijava agent framework

Tool Catalog

tnsai-tools ships 63 function-shape POJO toolkits exposing 209 @Tool-annotated methods across 29 categories. Each toolkit is a plain class with public methods annotated @Tool; the framework discovers them reflectively via ToolMethodRegistry and dispatches calls through ToolMethodDispatcher (the same path used for any user POJO registered with AgentBuilder.toolPojos(...)).

For creating your own toolkits, see Custom Tools. For which primitive to pick, see Actions vs Tools.

Quick Start

The compile-safe path is BuiltInTool — pass enum constants and the framework instantiates the backing POJO for you. AgentBuilder.build() also requires the accountability trio (TNS-298); focused snippets later on this page omit those three calls.

package com.example.tnsai.docs;

import com.tnsai.accountability.AuthorityScope;
import com.tnsai.accountability.LiabilitySink;
import com.tnsai.agents.Agent;
import com.tnsai.agents.AgentBuilder;
import com.tnsai.enums.BuiltInTool;
import com.tnsai.identity.AgentPrincipal;
import com.tnsai.llm.providers.OpenAIClient;
import com.tnsai.roles.Role;

public final class ToolsCatalogBuilderExample {
    private ToolsCatalogBuilderExample() {}

    public static Agent build(
        Role myRole,
        AgentPrincipal principal,
        LiabilitySink sink,
        AuthorityScope scope
    ) {
        return AgentBuilder.create()
            .llm(new OpenAIClient("gpt-4o"))
            .role(myRole)
            .builtInTools(
                BuiltInTool.WEB_SEARCH_TOOLS,
                BuiltInTool.UTILITY_TOOLS,
                BuiltInTool.PDF_TOOLS
            )
            .principal(principal)
            .liabilitySink(sink)
            .authorityScope(scope)
            .build();
    }
}
String response = agent.chat("What is the population of Tokyo? Triple it.");

The LLM sees every @Tool method on every registered toolkit as a callable function and dispatches by method name (brave_search, calculator, pdf_extract_text, …). Most toolkits read credentials from environment variables on first use:

export BRAVE_API_KEY=your-key
export OPENAI_API_KEY=your-key

How toolkits are organised

Each BuiltInTool enum entry maps a stable toolName to the FQCN of a POJO in tnsai-tools. The POJO's public @Tool-annotated methods are the actual functions exposed to the LLM. For example, BuiltInTool.CSV_TOOLS backs com.tnsai.tools.file.CsvTools, which exposes csv_summary, csv_columns, csv_filter, csv_head, csv_search.

Tables below list each toolkit's enum constant, backing class, the methods it exposes, and any required environment variables. Method names are what the LLM will see and call.

Web search, scraping, and specialised lookups.

EnumMethodsAPI key
WEB_SEARCH_TOOLSduckduckgo, wikipedia, wikidata, searxng, npm, maven_central, brave_search, serpapi, tavily, exaPer-provider (none for the first six; BRAVE_API_KEY, SERPAPI_API_KEY, TAVILY_API_KEY, EXA_API_KEY for the last four)
WEB_SCRAPING_TOOLSweb_scraper, firecrawlFIRECRAWL_API_KEY (firecrawl only)
QNA_TOOLShackernews, stackoverflow_searchOptional STACKEXCHANGE_KEY for Stack Overflow
SPECIALIZED_SEARCH_TOOLSyahoo_finance_lookup, yahoo_finance_news, wolfram_alphaWOLFRAM_APP_ID (wolfram only)

academic

Free / freemium scholarly databases.

EnumMethodsAPI key
ACADEMIC_TOOLSarxiv_search, pubmed_search, semantic_scholar_search, openalex_search, crossref_search, dblp_searchOptional SEMANTIC_SCHOLAR_API_KEY and OPENALEX_MAILTO
ACADEMIC_EXTRA_TOOLSorcid_search, orcid_get, unpaywall_lookup, biorxiv_recentUNPAYWALL_EMAIL for Unpaywall

file

Text and structured-document parsing.

EnumMethodsNotes
CSV_TOOLScsv_summary, csv_columns, csv_filter, csv_head, csv_searchFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
JSON_TOOLSjson_queryFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
XML_TOOLSxml_queryFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
PDF_TOOLSpdf_extract_text, pdf_extract_pages, pdf_metadata, pdf_merge, pdf_to_imageFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
MARKDOWN_TOOLSmarkitdownFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
FILE_IO_TOOLSfile_read, file_writeFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT

CSV_TOOLS — example

CsvTools is the canonical example for the function-shape pattern. The five methods below are independent — the LLM picks the one it needs.

Agent agent = AgentBuilder.create()
    .llm(new OpenAIClient("gpt-4o"))
    .role(myRole)
    .builtInTools(BuiltInTool.CSV_TOOLS)
    .principal(principal)
    .liabilitySink(sink)
    .authorityScope(scope)
    .build();

agent.chat("Summarise /data/sales.csv and list the column headers.");
// LLM emits two tool calls: csv_summary("/data/sales.csv") then csv_columns(...)
MethodPurposeNotes
csv_summaryRow/column counts plus per-column dtype/null statsDefault for "describe this CSV" prompts
csv_columnsExtract a subset of columns by nameCase-insensitive; falls back to numeric index
csv_filterRows where a column's value contains a substringCase-insensitive substring, capped at 100 rows
csv_headFirst N rows as a Markdown ASCII table
csv_searchAll rows where any cell contains the termCapped at 100 rows

The methods accept typed parameters (path, column name, etc.). Each method is a regular Java method whose signature defines the LLM-facing schema (via @Tool and @ToolParam).

communication

Email, chat, and SMS sending.

EnumMethodsConfig
EMAIL_TOOLSsmtp_send, gmail_send, gmail_inboxSMTP: SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_AUTH, SMTP_STARTTLS_ENABLE; Gmail: GMAIL_ACCESS_TOKEN, GMAIL_USER
MESSAGING_TOOLSslack_post, discord_post, twilio_sms_send, twilio_sms_statusSLACK_WEBHOOK_URL, DISCORD_WEBHOOK_URL; Twilio: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_FROM

fintech

Payment and BNPL platforms.

EnumMethodsAPI key
SQUARE_TOOLSsquare_create_payment, square_list_payments, square_create_invoice, square_create_customer, square_search_catalogSQUARE_ACCESS_TOKEN, SQUARE_LOCATION_ID; SQUARE_SANDBOX selects the sandbox host
CASH_APP_PAY_TOOLScashapp_create_request, cashapp_get_request, cashapp_cancel_requestCASHAPP_ACCESS_TOKEN; CASHAPP_SANDBOX selects the sandbox host
LIGHTNING_TOOLSlightning_create_invoice, lightning_pay_invoice, lightning_decode_invoiceLIGHTNING_NODE_URL, LND_MACAROON
AFTERPAY_TOOLSafterpay_create_checkout, afterpay_capture_payment, afterpay_get_orderAFTERPAY_MERCHANT_ID, AFTERPAY_SECRET_KEY; AFTERPAY_SANDBOX selects the sandbox host
PAYMENT_ANALYTICS_TOOLSpayment_revenue_summarySquare source: SQUARE_ACCESS_TOKEN, SQUARE_LOCATION_ID; SQUARE_SANDBOX selects the sandbox host

commerce

Storefront APIs.

EnumMethodsAPI key
SHOPIFY_TOOLSshopify_search, shopify_get_productSHOPIFY_STOREFRONT_TOKEN, SHOPIFY_SHOP_DOMAIN
ETSY_TOOLSetsy_search, etsy_get_listing, etsy_get_shopETSY_API_KEY

crm

Customer-relationship platforms.

EnumMethodsAPI key
HUBSPOT_TOOLShubspot_list_contacts, hubspot_get_contact, hubspot_create_contactHUBSPOT_ACCESS_TOKEN
SALESFORCE_TOOLSsalesforce_query, salesforce_search, salesforce_get_sobjectSALESFORCE_INSTANCE_URL, SALESFORCE_ACCESS_TOKEN

database

Relational, document, key-value, and vector stores.

EnumMethodsConfig
SQL_TOOLSsql_querySQL_JDBC_URL, SQL_JDBC_USERNAME, SQL_JDBC_PASSWORD, SQL_JDBC_MAX_ROWS; driver on classpath
MONGO_TOOLSmongo_find, mongo_countMONGODB_URI, MONGODB_DATABASE
REDIS_TOOLSredis_get, redis_keys, redis_ttl, redis_set, redis_delREDIS_URL
QDRANT_TOOLSqdrant_collections, qdrant_count, qdrant_search, qdrant_create_collection, qdrant_upsertQDRANT_URL, optional QDRANT_API_KEY
WEAVIATE_TOOLSweaviate_classes, weaviate_count, weaviate_search, weaviate_create_class, weaviate_upsertWEAVIATE_URL, optional WEAVIATE_API_KEY

sql_query is read-only. It rejects modifying CTEs and SELECT INTO (write tokens outside string literals, not a leading-keyword check) and opens the JDBC session Connection.setReadOnly(true) inside a read-only transaction so a WITH … DELETE prefix cannot commit even if a dialect accepts it. Dialects without read-only SQL still get setReadOnly plus auto-commit-off and rollback.

developer

Repo, dependency, and project introspection.

EnumMethodsAPI key
DEVELOPER_TOOLSgithub_search_repos, github_search_code, github_search_issues, github_search_users, jshell_evalGITHUB_TOKEN (optional, raises rate limit)
DEPENDENCY_TOOLSdependency_latest, dependency_compare, project_detect_typeNone
PROJECT_ANALYZER_TOOLSproject_tree, project_stats, project_languagesNone

productivity

Calendars, task trackers, docs.

EnumMethodsAPI key
GOOGLE_TOOLSgcal_list_events, gcal_get_event, gcal_create_event, gdrive_list_files, gdrive_read_file, gdrive_create_fileGOOGLE_CALENDAR_ACCESS_TOKEN, GOOGLE_DRIVE_ACCESS_TOKEN
JIRA_TOOLSjira_search, jira_get_issue, jira_create_issue, jira_transition_issueJIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN
NOTION_TOOLSnotion_search, notion_get_page, notion_query_database, notion_create_pageNOTION_API_KEY
TRELLO_TOOLStrello_list_boards, trello_get_board, trello_list_cards, trello_create_card, trello_move_cardTRELLO_API_KEY, TRELLO_TOKEN

media

OpenAI audio and Chatterbox TTS.

EnumMethodsAPI key
MEDIA_TOOLSwhisper_transcribe, openai_ttsOPENAI_API_KEY
CHATTERBOX_TOOLSchatterbox_ttsCHATTERBOX_API_URL, optional CHATTERBOX_API_KEY

audio

Non-OpenAI speech synthesis and transcription.

EnumMethodsAPI key
TEXT_TO_SPEECH_TOOLSelevenlabs_tts, cartesia_tts, deepgram_ttsELEVENLABS_API_KEY, CARTESIA_API_KEY, or DEEPGRAM_API_KEY
SPEECH_TO_TEXT_TOOLSdeepgram_transcribe, assemblyai_transcribe, replicate_whisperDEEPGRAM_API_KEY, ASSEMBLYAI_API_KEY, or REPLICATE_API_TOKEN

social

Social-network APIs.

EnumMethodsAPI key
TWITTER_TOOLStwitter_search, twitter_user, twitter_timelineTWITTER_BEARER_TOKEN
REDDIT_TOOLSreddit_search, reddit_subreddit_posts, reddit_post_commentsREDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET, optional REDDIT_USER_AGENT
LINKEDIN_TOOLSlinkedin_me, linkedin_shareLINKEDIN_ACCESS_TOKEN

ai

Multimodal helpers.

EnumMethodsAPI key
VISION_TOOLSimage_analyzeGEMINI_API_KEY
IMAGE_GEN_TOOLSdalle3_generate, flux_generate, stability_generateOPENAI_API_KEY, REPLICATE_API_TOKEN, or STABILITY_API_KEY

code

Code execution through the framework's Sandbox SPI. Both built-in tools route through SandboxFactory.byId("process") by default with ResourceLimits.standard() + NetPolicy.denyAll(). Pass an explicit SandboxFactory + image-bearing SandboxSpec via the full-control constructors for container / WASM / Firecracker isolation.

EnumMethodsHost requirement
JS_EXECUTION_TOOLSjs_executePATH; optional NODE_PATH_BINARY selects the Node executable
PYTHON_EXECUTION_TOOLSpython_execute, python_versionPATH; optional PYTHON_PATH and PYTHON_VENV_PATH select the interpreter and environment
E2B_SANDBOX_TOOLSe2b_create, e2b_execute, e2b_upload, e2b_download, e2b_install, e2b_list, e2b_killE2B_API_KEY

utility

Math, hashing, datetime, encoding.

EnumMethodsAPI key
UTILITY_TOOLScalculator, hash, datetime_now, datetime_diff, datetime_addNone
ENCODING_TOOLSqr_generate, qr_base64, qr_read, google_translateGOOGLE_TRANSLATE_API_KEY (translate only)

diagram

Diagram-as-code rendering.

EnumMethodsAPI key
DIAGRAM_TOOLSmermaid_render, excalidraw_generateNone

document

DOCX / Office / image conversion.

EnumMethodsAPI key
DOCUMENT_TOOLSdocument_read, markdown_to_html, image_convert, image_info, slides_createFile guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT
DOCLING_TOOLSdocling_parseOptional Docling MCP or CLI; file guard: TNSAI_FILE_MAX_READ_BYTES, TNSAI_FILE_MAX_WRITE_BYTES, TNSAI_FILE_ALLOWED_EXTS, TNSAI_FILE_SANDBOX_ROOT — see Docling

visualization

Charts, tables, infographics.

EnumMethodsAPI key
VISUALIZATION_TOOLSchart_ascii, table_format, infographic_templatesNone

realtime

Live FX, crypto, weather feeds.

EnumMethodsAPI key
REALTIME_TOOLScrypto_price, fx_rates, fx_convert, weather_currentOPENWEATHER_API_KEY for weather; CoinGecko and Frankfurter calls need no key

finance

Borsa Istanbul market data.

EnumMethodsAPI key
FINANCE_TOOLSbist_quote, bist_index, bist_fx, bist_goldNone

trading

Prediction markets.

EnumMethodsAPI key
TRADING_TOOLSpolymarket_markets, polymarket_search, polymarket_pricesNone (read-only)

scraping

Apify actor execution.

EnumMethodsAPI key
SCRAPING_TOOLSapify_run_actor, apify_search_actors, apify_actor_infoAPIFY_API_KEY

knowledge

In-memory knowledge graph. Live triples are also the bundled GraphRAG backend when tnsai-intelligence is installed — see KnowledgeTools as GraphRAG.

EnumMethodsAPI key
KNOWLEDGE_TOOLSkg_extract_entities, kg_extract_relations, kg_add_triple, kg_queryNone

memory

Persistent recall.

EnumMethodsAPI key
MEMORY_TOOLSreever_store, reever_recall, reever_searchREEVER_API_URL selects the Reever endpoint

goose

Desktop automation.

EnumMethodsAPI key
GOOSE_TOOLSgit_status, git_log, git_diff, git_branches, screenshot, system_infogit on PATH
CLIPBOARD_TOOLSclipboard_read_text, clipboard_write_textNone (headless-aware)

project

Repo-level read helpers.

EnumMethodsAPI key
PROJECT_TOOLSproject_context, project_read_file, agentsmd_parse, agentsmd_generateNone (sandboxed by Role policy)

agentsmd_parse returns an AgentsMdContent record (intro + ordered sections: [{level, title, body}]) parsed from AGENTS.md, with case-variant + CLAUDE.md + README.md fallback. Use this when an agent needs to route on individual sections (e.g. pull the "Setup" body) rather than the whole document. agentsmd_generate produces a draft AGENTS.md by detecting the build system from pom.xml / package.json / pyproject.toml / Cargo.toml / go.mod and filling in language-appropriate setup + test commands — returns the markdown string, the caller decides whether to write it.

system

HTTP and tool discovery.

EnumMethodsAPI key
SYSTEM_TOOLShttp_request, tool_searchTNSAI_HTTP_ALLOW_PRIVATE opts into private-network requests

Direct instantiation

If you need to register a toolkit outside the AgentBuilder.builtInTools(...) path — for example, from a plugin loader — every entry has a no-arg instantiate() method that returns a fresh POJO ready for ToolMethodRegistry:

Object csvToolkit = BuiltInTool.CSV_TOOLS.instantiate();
// csvToolkit is a com.tnsai.tools.file.CsvTools instance

instantiate() throws BuiltInToolInstantiationException if tnsai-tools is missing from the classpath (the FQCN string isn't resolvable) or if the POJO's public no-arg constructor fails.

Authoritative source

The full per-toolkit Javadoc — including every @Tool method's exact signature and the corresponding @ToolParam constraints — lives in com.tnsai.enums.BuiltInTool and the backing POJOs under com.tnsai.tools.*.