Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-tool-function-calling-patternsgit clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/langchain4j-tool-function-calling-patterns)<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/langchain4j-tool-function-calling-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/langchain4j-tool-function-calling-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/langchain4j-tool-function-calling-patterns"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/langchain4j-tool-function-calling-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk warn
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00082 | $0.02027 |
| Opus 5 | $0.00041 | $0.01014 |
| Sonnet 5 | $0.00016 | $0.00405 |
| Haiku 4.5 | $0.00008 | $0.00203 |
Grade A, and why
langchain4j-tool-function-calling-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LangChain4j Tool & Function Calling Patterns
Provides patterns for annotating methods as tools, configuring tool executors, registering tools with AI services, validating parameters, and handling tool execution errors in LangChain4j applications.
Overview
LangChain4j uses the @Tool annotation to expose Java methods as callable functions for AI agents. The AiServices builder registers tools with a chat model, enabling LLMs to perform actions beyond text generation: database queries, API calls, calculations, and business system integrations. Parameters use @P for descriptions that guide the LLM.
When to Use
- Building AI agents that call external tools (weather, stocks, database queries)
- Defining function specifications for LLM tool use (
@Tool,@Pannotations) - Registering and managing tool sets with
AiServices.builder().tools() - Handling tool execution errors, timeouts, and hallucinated tool names
- Implementing context-aware tools that inject user state via
@ToolMemoryId - Configuring dynamic tool providers for large or conditional tool sets
Instructions
1. Annotate Methods with @Tool
Define a tool class with methods annotated @Tool. Provide a description as the first parameter. Use @P for each parameter description.
public class WeatherTools {
private final WeatherService weatherService;
public WeatherTools(WeatherService weatherService) {
this.weatherService = weatherService;
}
@Tool("Get current weather for a city")
public String getWeather(
@P("City name") String city,
@P("Temperature unit: celsius or fahrenheit") String unit) {
return weatherService.getWeather(city, unit);
}
}
Validate: Create an instance and confirm the class loads without errors.
2. Register Tools with AiServices
Use AiServices.builder() to register tool instances with the chat model.
MathAssistant assistant = AiServices.builder(MathAssistant.class)
.chatModel(chatModel)
.tools(new Calculator(), new WeatherTools(weatherService))
.build();
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 219 lines · 82 tokens per session scan A 6cd8ae417473
langchain4j-tool-function-calling-patterns is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (343 stars, last pushed yesterday), licensed MIT. It adds 82 tokens to every session and 2,027 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.
Other skills, from other repositories
loom-prompt-engineering
Designs and optimizes prompts for large language models including system prompts, agent signals, and few-shot examples.
metaprompt
Generate a complete, ready-to-use prompt for a target model and harness. Triggers: metaprompt, generate a prompt for, write me a prompt, create a system prompt, prompt engineer this, optimize this prompt.
improve-prompt
Critique and rewrite a prompt using prompt engineering best practices: clarity, examples, XML structure, role, explicit output format, and positive-over-negative instructions. Asks 1-3 targeted questions to fill missing context, then returns a short critique plus a drop-in rewritten prompt. Use when the user wants to…
write-a-prompt
Creates a copy-ready prompt from a rough request, notes, source material, or the current conversation using OpenAI's prompting guidance. Use when the user invokes $write-a-prompt or /write-a-prompt, types a common misspelling such as /write-a-promopt or /wite-a-prompt, asks to "write a prompt for me," asks to turn the…
add-ai
Use when adding an AI/LLM feature to a product - chat, generation, summarization, extraction, semantic search - or when the user says add AI, use Claude, chatbot, embeddings.
agent-orchestration-improve-agent
Systematic improvement of existing agents through performance analysis, prompt engineering, and continuous iteration.