Enum Class BuiltInTool
- All Implemented Interfaces:
Serializable,Comparable<BuiltInTool>,Constable
tnsai-tools.
Each entry maps a stable toolName (used in role-binding
APIs and SCOP serialisation) to the fully-qualified class of the POJO that
carries the @Tool-annotated methods.
One enum value = one POJO class = one auto-instantiable bundle of
@Tool methods. For example, CSV_TOOLS backs
com.tnsai.tools.file.CsvTools, which exposes
csv_summary, csv_columns, csv_filter,
csv_head, csv_search.
Agent-level registration
Agent agent = AgentBuilder.create()
.id("data-analyst")
.llm(llmClient)
.builtInTools(BuiltInTool.CSV_TOOLS, BuiltInTool.PDF_TOOLS, BuiltInTool.JSON_TOOLS)
.build();
The agent's ToolMethodDispatcher resolves any @Tool
methods the LLM emits across all registered toolkits.
Direct instantiation
Object csvToolkit = BuiltInTool.CSV_TOOLS.instantiate(); // ...register with ToolMethodRegistry by hand if needed
The backing class is referenced by FQCN string rather than a Class<?>
literal so that tnsai-core does not gain a circular compile-time
dependency on tnsai-tools. instantiate() resolves the class
via Class.forName(String) at call time. If tnsai-tools is
missing from the classpath, instantiate() throws
BuiltInToolInstantiationException pointing at the missing dependency.
All shipped POJOs are auto-instantiable (public no-arg constructor). Toolkits requiring credentials read them from environment variables or system properties at the first call rather than via constructor arguments.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAuthor-attribution and open-access lookups complementingACADEMIC_TOOLS.Academic paper search across six free databases.Afterpay (Clearpay) merchant API.Cash App Pay merchant API.Resemble Chatterbox text-to-speech.OS clipboard read / write.CSV inspection and querying.Public package-registry lookup (no auth).GitHub code-search + JShell.Diagram-as-code rendering.Advanced document parsing through an optional Docling runtime.Office document + image conversions.Remote sandboxed code execution via E2B.Email via SMTP and Gmail API.QR codes + translation.Etsy Open API v3.Generic file I/O — sandboxed by Role policy.Borsa Istanbul (BIST) market data.Google Calendar + Drive.Local git repo + screenshot + system info.HubSpot CRM v3 API.Text-to-image generation across the three most common providers.Jira Cloud REST.In-process JavaScript via GraalVM JS.JSONPath query against a file or literal JSON string.In-memory knowledge graph (entities + relations + triples).Lightning Network (LNbits / LND-REST).LinkedIn API.Markdown ↔ rich-text conversion.Whisper STT + OpenAI TTS.Long-term memory store backed by Reever.Out-of-band chat / SMS notifications.MongoDB read access.Notion API.Cross-processor payment analytics.PDF text + metadata extraction with page ranges.Static project introspection over a local source tree.Repository-aware reading helpers (sandboxed by Role policy).Subprocess Python execution.Qdrant vector-search.Programmer-flavour Q&A.Real-time public feeds.Reddit API.Redis key-value / hash / TTL ops.Salesforce REST API.Apify actor execution.Shopify Storefront API.Domain-specific lookups.Speech-to-text across the three most popular non-OpenAI providers, complementingMediaTools.whisperTranscribe.JDBC SQL execution.Square Payments + Catalog.Low-level system primitives.Text-to-speech across the three most popular non-OpenAI providers, complementingMediaTools.openaiTts.Polymarket prediction markets (read-only).Trello REST.Twitter / X API v2.Math + hashing + datetime helpers.Image analysis via Google Gemini 2.0 Flash.Lightweight visualisation primitives.Weaviate vector-search.Heavyweight scraping for JS-rendered pages.Ten free / freemium web-search providers in one toolkit.XPath query against XML. -
Method Summary
Modifier and TypeMethodDescriptionFully-qualified class name of the backing POJO intnsai-tools.Stable identifier used in role-binding APIs and SCOP serialisation.Reflectively instantiate the backing POJO via its public no-arg constructor.static BuiltInToolReturns the enum constant of this class with the specified name.static BuiltInTool[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
ACADEMIC_TOOLS
Academic paper search across six free databases. No API keys.arxiv_search— arXiv preprintspubmed_search— PubMed biomedical literature (NCBI E-utilities)semantic_scholar_search— Semantic Scholar with citation countsopenalex_search— OpenAlex open scholarly graphcrossref_search— CrossRef DOI registrydblp_search— DBLP computer-science bibliography
-
ACADEMIC_EXTRA_TOOLS
Author-attribution and open-access lookups complementingACADEMIC_TOOLS.orcid_search— ORCID researcher searchorcid_get— fetch full ORCID record by iDunpaywall_lookup— open-access copy lookup by DOIbiorxiv_recent— bioRxiv preprint feed
-
VISION_TOOLS
Image analysis via Google Gemini 2.0 Flash. RequiresGEMINI_API_KEY.image_analyze— describe / answer questions about an image (file path, http(s) URL, orbase64:-prefixed string)
-
IMAGE_GEN_TOOLS
Text-to-image generation across the three most common providers. Each method picks a different upstream so the LLM can choose between cost / latency / quality at call time.dalle3_generate— OpenAI DALL-E 3 (OPENAI_API_KEY; ~$0.04 / standard 1024×1024)flux_generate— Black Forest Labs FLUX via Replicate sync API (REPLICATE_API_TOKEN; schnell ~$0.003, dev ~$0.025, pro ~$0.055)stability_generate— Stability AI Stable Image v2 (STABILITY_API_KEY; core ~$0.03, sd3 ~$0.035, ultra ~$0.08). Returns the generated bytes as adata:image/png;base64,…URI (Stability's JSON envelope returns bytes, not a hosted URL).
-
TEXT_TO_SPEECH_TOOLS
Text-to-speech across the three most popular non-OpenAI providers, complementingMediaTools.openaiTts. Each method picks a different upstream so the LLM can choose between cost / latency / voice quality at call time. All three return a uniform JSON envelope{provider, model, audio_uri, audio_bytes}whereaudio_uriis adata:audio/mpeg;base64,…data URI.elevenlabs_tts— ElevenLabs Multilingual v2 / Turbo / Flash (ELEVENLABS_API_KEY; ~$0.18 / 1k chars)cartesia_tts— Cartesia Sonic-2 (CARTESIA_API_KEY; ~$0.030 / 1k chars; ~75ms TTFB)deepgram_tts— Deepgram Aura (12 voice presets) (DEEPGRAM_API_KEY; ~$0.015 / 1k chars — cheapest)
-
SPEECH_TO_TEXT_TOOLS
Speech-to-text across the three most popular non-OpenAI providers, complementingMediaTools.whisperTranscribe. Each method picks a different upstream so the LLM can choose between latency / accuracy / cost at call time. All three return a uniform JSON envelope{provider, model, text, language, …}.deepgram_transcribe— Deepgram Nova-2 (sync, ~$0.0043/min)assemblyai_transcribe— AssemblyAI Universal-2 (async with internal polling, ~$0.0045/min, best accuracy)replicate_whisper— OpenAI Whisper large-v3 hosted on Replicate (REPLICATE_API_TOKEN— same key as FLUX image generation; ~$0.0007/min — cheapest)
-
E2B_SANDBOX_TOOLS
Remote sandboxed code execution via E2B. RequiresE2B_API_KEY.e2b_create— provision a fresh sandbox VMe2b_execute— run a shell or interpreter commande2b_upload— push a local file into the sandboxe2b_download— pull a sandbox file back to the hoste2b_install— install a package in the sandboxe2b_list— list active sandboxese2b_kill— terminate a sandbox
-
JS_EXECUTION_TOOLS
In-process JavaScript via GraalVM JS. No external deps.js_execute— evaluate a JS snippet, returns string result
-
PYTHON_EXECUTION_TOOLS
Subprocess Python execution. Requirespython3onPATH.python_execute— run a Python script, capture stdoutpython_version— report the active interpreter version
-
ETSY_TOOLS
Etsy Open API v3. RequiresETSY_API_KEY.etsy_search— full-text listing searchetsy_get_listing— fetch a single listing by idetsy_get_shop— fetch shop metadata
-
SHOPIFY_TOOLS
Shopify Storefront API. RequiresSHOPIFY_API_KEY+ shop domain.shopify_search— product search by keywordshopify_get_product— fetch a product by handle/id
-
EMAIL_TOOLS
Email via SMTP and Gmail API.smtp_send— send via configured SMTP host (SMTP_HOST/SMTP_USER/SMTP_PASS)gmail_send— send via Gmail REST (GMAIL_OAUTH_TOKEN)gmail_inbox— list recent inbox messages
-
MESSAGING_TOOLS
Out-of-band chat / SMS notifications.slack_post— Incoming-Webhook post (SLACK_WEBHOOK_URL)discord_post— Discord Webhook post (DISCORD_WEBHOOK_URL)twilio_sms_send— send SMS (TWILIO_SID/TWILIO_TOKEN)twilio_sms_status— check delivery status of a message SID
-
HUBSPOT_TOOLS
HubSpot CRM v3 API. RequiresHUBSPOT_ACCESS_TOKEN.hubspot_list_contacts— paginate contact recordshubspot_get_contact— fetch a contact by idhubspot_create_contact— create a new contact
-
SALESFORCE_TOOLS
Salesforce REST API. RequiresSF_ACCESS_TOKEN+ instance URL.salesforce_query— run a SOQL querysalesforce_search— SOSL full-text search across sObjectssalesforce_get_sobject— fetch a single sObject by id
-
MONGO_TOOLS
MongoDB read access. RequiresMONGO_URI.mongo_find— find documents matching a JSON filtermongo_count— count documents matching a filter
-
QDRANT_TOOLS
Qdrant vector-search. RequiresQDRANT_URL(+ optional API key).qdrant_collections— list all collectionsqdrant_count— count points in a collectionqdrant_search— top-k vector similarity searchqdrant_create_collection— create a collection with given dim/metricqdrant_upsert— insert or replace points
-
REDIS_TOOLS
Redis key-value / hash / TTL ops. RequiresREDIS_URL.redis_get— read a key's valueredis_keys— list keys matching a glob patternredis_ttl— read a key's remaining TTLredis_set— set a key (with optional EX seconds)redis_del— delete keys
-
SQL_TOOLS
JDBC SQL execution. RequiresJDBC_URL+ driver on classpath.sql_query— execute a parameterised SELECT, returns rows as JSON
-
WEAVIATE_TOOLS
Weaviate vector-search. RequiresWEAVIATE_URL.weaviate_classes— list schema classesweaviate_count— count objects in a classweaviate_search— vector / hybrid searchweaviate_create_class— create a schema classweaviate_upsert— insert or replace objects
-
DEPENDENCY_TOOLS
Public package-registry lookup (no auth).dependency_latest— latest version of a Maven / NPM / PyPI packagedependency_compare— diff two versions of the same packageproject_detect_type— sniff project type from manifest files
-
DEVELOPER_TOOLS
GitHub code-search + JShell. OptionalGITHUB_TOKENfor higher rate limits.github_search_repos— search repositoriesgithub_search_code— search code across GitHubgithub_search_issues— search issues + PRsgithub_search_users— search users / orgsjshell_eval— evaluate Java in an in-process JShell
-
PROJECT_ANALYZER_TOOLS
Static project introspection over a local source tree.project_tree— render the directory treeproject_stats— file count / size / language statsproject_languages— language breakdown by SLOC
-
DIAGRAM_TOOLS
Diagram-as-code rendering. No keys.mermaid_render— Mermaid → SVG/PNG (flowchart, sequence, ER, gantt, …)excalidraw_generate— Excalidraw JSON from a pipe-separated DSL
-
DOCUMENT_TOOLS
Office document + image conversions.document_read— extract text from DOCX / RTF / ODFmarkdown_to_html— render Markdown to HTMLimage_convert— convert image format (PNG / JPG / WebP / …)image_info— read image dimensions, format, EXIFslides_create— generate a PPTX from a slide outline
-
DOCLING_TOOLS
Advanced document parsing through an optional Docling runtime.docling_parse— convert PDF/Office/image sources to Markdown
-
CSV_TOOLS
CSV inspection and querying. Accepts both file paths and literal CSV strings.csv_summary— row count, column count, per-column dtype/null statscsv_columns— extract a subset of columns by namecsv_filter— return rows where a column's value matches a substringcsv_head— first N rows as a Markdown ASCII tablecsv_search— find rows where any cell contains the term
-
FILE_IO_TOOLS
Generic file I/O — sandboxed by Role policy.file_read— read a UTF-8 text file by absolute pathfile_write— write a UTF-8 text file (overwrites)
-
JSON_TOOLS
JSONPath query against a file or literal JSON string.json_query— Jayway JsonPath expression evaluation
-
MARKDOWN_TOOLS
Markdown ↔ rich-text conversion.markitdown— convert any supported source (DOCX/PDF/HTML/…) to Markdown via Microsoft's MarkItDown
-
PDF_TOOLS
PDF text + metadata extraction with page ranges.pdf_extract_text— extract all text as a single stringpdf_extract_pages— text from specified page rangepdf_metadata— title/author/created/page-countpdf_merge— concatenate multiple PDFs into onepdf_to_image— render pages as PNG/JPEG
-
XML_TOOLS
XPath query against XML.xml_query— evaluate an XPath expression on a file or literal XML
-
FINANCE_TOOLS
Borsa Istanbul (BIST) market data. No keys.bist_quote— current price for a BIST symbol (e.g.THYAO)bist_index— index level (XU100, XU030, sector indices)bist_fx— TRY-quoted FX rates (USD/TRY, EUR/TRY, …)bist_gold— gram / quarter / full gold prices in TRY
-
AFTERPAY_TOOLS
Afterpay (Clearpay) merchant API. RequiresAFTERPAY_API_KEY.afterpay_create_checkout— start a checkout sessionafterpay_capture_payment— finalise an authorised paymentafterpay_get_order— fetch order detail by token
-
CASH_APP_PAY_TOOLS
Cash App Pay merchant API. RequiresCASHAPP_CLIENT_ID+ secret.cashapp_create_request— create a payment requestcashapp_get_request— fetch a request by idcashapp_cancel_request— cancel a pending request
-
LIGHTNING_TOOLS
Lightning Network (LNbits / LND-REST). RequiresLN_API_URL+ macaroon.lightning_create_invoice— generate a BOLT-11 invoicelightning_pay_invoice— pay a BOLT-11 invoicelightning_decode_invoice— parse a BOLT-11 string into fields
-
PAYMENT_ANALYTICS_TOOLS
Cross-processor payment analytics.payment_revenue_summary— revenue / refund-rate / MRR snapshot
-
SQUARE_TOOLS
Square Payments + Catalog. RequiresSQUARE_ACCESS_TOKEN.square_create_payment— charge a card/wallet tokensquare_list_payments— list payments in a date rangesquare_create_invoice— create an invoicesquare_create_customer— create a customer recordsquare_search_catalog— search products in catalog
-
CLIPBOARD_TOOLS
OS clipboard read / write. Headless-aware (returns blank in headless mode).clipboard_read_text— read current clipboard textclipboard_write_text— write text to clipboard
-
GOOSE_TOOLS
Local git repo + screenshot + system info. Requiresgiton PATH.git_status— porcelain status for a repo pathgit_log— recent commit loggit_diff— unified diff (working tree or commit range)git_branches— list local + remote branchesscreenshot— capture a desktop screenshot to PNGsystem_info— OS, CPU, RAM, disk-free
-
KNOWLEDGE_TOOLS
In-memory knowledge graph (entities + relations + triples). Each instance has its own bag. Live instances are the GraphRAG backend whentnsai-intelligenceis on the classpath (@Search(strategy = GRAPH), sourceknowledge-tools).kg_extract_entities— NER over arbitrary textkg_extract_relations— relation extraction over textkg_add_triple— add a (subject, predicate, object) triplekg_query— pattern-match query against the graph
-
CHATTERBOX_TOOLS
Resemble Chatterbox text-to-speech. RequiresCHATTERBOX_API_KEY.chatterbox_tts— synthesise audio for a given text + voice id
-
MEDIA_TOOLS
Whisper STT + OpenAI TTS. RequiresOPENAI_API_KEY.whisper_transcribe— speech-to-text from audio file/URLopenai_tts— text-to-speech with OpenAI voice models
-
MEMORY_TOOLS
Long-term memory store backed by Reever.reever_store— persist a fact / observationreever_recall— recall facts by exact keyreever_search— semantic search over stored facts
-
GOOGLE_TOOLS
Google Calendar + Drive. RequiresGOOGLE_OAUTH_TOKEN.gcal_list_events— list events in a calendar/date-rangegcal_get_event— fetch a single eventgcal_create_event— create an event with attendeesgdrive_list_files— list / search filesgdrive_read_file— download a file's contentgdrive_create_file— upload a new file
-
JIRA_TOOLS
Jira Cloud REST. RequiresJIRA_BASE_URL+JIRA_API_TOKEN.jira_search— JQL searchjira_get_issue— fetch issue by keyjira_create_issue— create a new issuejira_transition_issue— move an issue across workflow states
-
NOTION_TOOLS
Notion API. RequiresNOTION_TOKEN.notion_search— search pages/databases by querynotion_get_page— fetch a page's blocksnotion_query_database— filter/sort a databasenotion_create_page— create a page in a database/parent
-
TRELLO_TOOLS
Trello REST. RequiresTRELLO_KEY+TRELLO_TOKEN.trello_list_boards— list user's boardstrello_get_board— fetch a board's lists/cardstrello_list_cards— list cards in a listtrello_create_card— create a cardtrello_move_card— move a card to another list
-
PROJECT_TOOLS
Repository-aware reading helpers (sandboxed by Role policy).project_context— concatenate AGENTS.md / CLAUDE.md / README.mdproject_read_file— read a file relative to project root
-
REALTIME_TOOLS
Real-time public feeds. No keys (uses CoinGecko / Frankfurter / OpenWeatherMap public).crypto_price— spot price for a crypto symbol via CoinGeckofx_rates— ECB FX rates via Frankfurterfx_convert— convert an amount between two currenciesweather_current— current weather for a city
-
SCRAPING_TOOLS
Apify actor execution. RequiresAPIFY_TOKEN.apify_run_actor— run an actor with input JSON, await datasetapify_search_actors— search the Apify Storeapify_actor_info— fetch an actor's metadata + input schema
-
QNA_TOOLS
Programmer-flavour Q&A.hackernews— Algolia HN searchstackoverflow_search— Stack Exchange API search
-
SPECIALIZED_SEARCH_TOOLS
Domain-specific lookups.yahoo_finance_lookup— quote/profile for a tickeryahoo_finance_news— news headlines for a tickerwolfram_alpha— computational answers (WOLFRAM_APP_ID)
-
WEB_SCRAPING_TOOLS
Heavyweight scraping for JS-rendered pages.web_scraper— JSoup + readability text extractionfirecrawl— JS-rendered scraping via Firecrawl (FIRECRAWL_API_KEY)
-
WEB_SEARCH_TOOLS
Ten free / freemium web-search providers in one toolkit. Pick the provider per call; missing API keys yield a clear error.duckduckgo— DuckDuckGo Instant Answer (no key)wikipedia— Wikipedia search (no key)wikidata— Wikidata structured search (no key)searxng— privacy-first metasearch (no key)npm— NPM package search (no key)maven_central— Maven Central artifact search (no key)brave_search— Brave Search (BRAVE_API_KEY)serpapi— Google via SerpAPI (SERPAPI_API_KEY)tavily— Tavily AI search (TAVILY_API_KEY)exa— Exa neural search (EXA_API_KEY)
-
LINKEDIN_TOOLS
LinkedIn API. RequiresLINKEDIN_ACCESS_TOKEN.linkedin_me— fetch the authenticated profilelinkedin_share— post a share/update
-
REDDIT_TOOLS
Reddit API. RequiresREDDIT_CLIENT_ID+REDDIT_CLIENT_SECRET.reddit_search— site-wide searchreddit_subreddit_posts— recent posts in a subredditreddit_post_comments— comments under a post
-
TWITTER_TOOLS
Twitter / X API v2. RequiresX_BEARER_TOKEN.twitter_search— recent-tweet searchtwitter_user— user profile lookuptwitter_timeline— user's recent timeline
-
SYSTEM_TOOLS
Low-level system primitives.http_request— generic HTTP GET/POST/PUT/DELETE/PATCHtool_search— search the agent's currently registered tool catalog
-
TRADING_TOOLS
Polymarket prediction markets (read-only). No keys.polymarket_markets— list active marketspolymarket_search— search markets by keywordpolymarket_prices— current outcome prices for a market
-
ENCODING_TOOLS
QR codes + translation. OptionalGOOGLE_TRANSLATE_API_KEYfor translate.qr_generate— generate a QR PNG fileqr_base64— generate QR as a base64 stringqr_read— decode a QR from an image filegoogle_translate— translate text between languages
-
UTILITY_TOOLS
Math + hashing + datetime helpers. No keys.calculator— evaluate arithmetic expressions (+-*/^())hash— MD5 / SHA-1 / SHA-256 / SHA-512 of a stringdatetime_now— current UTC + zoned timestampdatetime_diff— difference between two ISO-8601 timestampsdatetime_add— add a duration to a timestamp
-
VISUALIZATION_TOOLS
Lightweight visualisation primitives.chart_ascii— render a bar/line chart as ASCII arttable_format— render rows as a Markdown / ASCII tableinfographic_templates— list available infographic templates
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getToolName
Stable identifier used in role-binding APIs and SCOP serialisation. Lower-snake-case, matches@Tool(name=...)on at least one method of the backing POJO when the POJO's name is the same as the toolkit. -
getClassName
Fully-qualified class name of the backing POJO intnsai-tools. Use this withClass.forName(String)orinstantiate(). -
instantiate
Reflectively instantiate the backing POJO via its public no-arg constructor. The returned object is a fresh instance with no shared state — register it with aToolMethodRegistryor pass it toAgentBuilder.tools(...)to surface its@Toolmethods.- Returns:
- a new instance of the backing POJO class
- Throws:
BuiltInToolInstantiationException- if the class is missing from the classpath (typically becausetnsai-toolsis not a dependency) or if reflective instantiation fails
-