frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Understanding Tool Calling in LLMs – Step-by-Step with REST and Spring AI

https://muthuishere.medium.com/understanding-tool-function-calling-in-llms-step-by-step-examples-in-rest-and-spring-ai-2149ecd6b18b
72•muthuishere•11h ago

Comments

upghost•6h ago
I think it's interesting and odd that tool calling took the form of this gnarly json blob. I much prefer the NexusRaven[1] style where you provide python function stubs with docstrings and get back python function invocations with the arguments populated. Of course I don't really understand why MCP is popular over REST or CLI, either.

[1]: https://github.com/nexusflowai/NexusRaven-V2

max-privatevoid•5h ago
The actual API call is still going to be JSON. How do you deal with that? Pack your Python function definitions into an array of huge opaque strings? And who would want to write a parser for that?
upghost•4h ago
I'm sure you realize it gets reassembled into "huge opaque strings" when it is fed into the LLM as context. The arbitrary transport of the context as JSON is just a bit of protocol theater.

You don't really have to parse the output, Python already has a parser in the form of the AST library[1].

But I get your drift. Depending on your workflow this could seem like more work.

[1]: https://docs.python.org/3/library/ast.html#module-ast

max-privatevoid•4h ago
The inference engine can do whatever it wants. This is already the case. The actual format of the tool call text varies by model, and the inference engine handles the translation from/to the JSON representation, that's the least of its concerns.

What I don't want to happen is for some shitty webdev who writes an AI client in JavaScript to be forced to write a custom parser for some bespoke tool call language (call it "MLML", the Machine Learning Markup Language, to be superseded by YAMLML and then YAYAMLML, ...), or god forbid, somehow embed a WASM build of Python in their project to be able to `import ast`, instead of just parsing JSON and looking at the fields of the resulting object.

nullorempty•5h ago
I don't think Spring is well regarded on HN.
sorokod•5h ago
"Just write this...." adds an annotation

One of the many issues with Spring is that abstractions it provides are extremely leaky [1]. It leaks frequently and when it does, an engineer is faced with the need to comprehend a pile of technology[2] that was supposed to be abstracted away in the first place.

- [1] https://en.wikipedia.org/wiki/Leaky_abstraction

- [2] https://github.com/spring-projects/spring-ai

th0ma5•5h ago
I think about this occasionally trying to rationalize it. I see similar patterns in other things like R and Julia where they design something in the environment to seem like a composable tool, and maybe it is but only within two or three specific compositions and then the way the environment is described sure seems to imply some kind of universality but it just doesn't work. Some even seem to keep patching every leak (maybe Spring means Spring a leak? Haha) and there's a sunk cost fallacy thing with an immense documentation page.
sorokod•4h ago
There is similarity between Spring and "Buy now, pay later" schemes. You do often get a working feature quickly while having the price of evolving and maintaining that feature spread over some future.

This is the best I can do for rationalizing Spring.

xienze•4h ago
In what ways are the abstractions leaky? @Tool or @GetMapping make no demands on how to implement “this is a tool” or “this is a GET REST endpoint.” That they’re coupled with Spring (or rather, Spring is the only implementation for the semantics of these annotations) doesn’t constitute a leaky abstraction.
xyzzy123•3h ago
This is fair. I think the complaint is that Spring is _beautiful_ in up to medium sized demos, but in any sufficiently large application you always seem to need to dig in and figure out what Spring is doing inside those annotations and do something unspeakable involving the giant stack of factory factory context thread local bean counter manager handler method proxy managers etc.

Also Spring is a kind of franchise or brand, and the individual projects under the umbrella vary a lot in quality.

delecti•3h ago
Just about any tool will require a bunch of work at some point in the scale. Some front-load that, and some make it easy to get started but then you hit a point where you need to peek under the covers. Personally I prefer the latter, though I'm sure there's a lot of Stockholm syndrome involved in how I feel about Spring. And Spring's popularity means you're probably not the only one to hit any given problem.
sorokod•3h ago
This is a rational attitude but my experience is that engineers do not get to "the latter" at their leasure. What typically happens is that peeking under the covers is forced on them along with a tight timeline.
layer8•3h ago
The precise semantics usually aren’t that well specified, and debugging is difficult when something goes wrong. Annotation-based frameworks are generally more difficult to reason about than libraries you only call in to. One reason is that with frameworks you don’t know very well which parts of the framework code are all involved in calling your code, whereas with libraries the answer usually is “the parts you call in to”.

Spring has more “synergy” in a sense than using a bunch of separate libraries, but because of that it’s also a big ball of mud that your code sits on top of, but isn’t on top of it in the sense of being in control.

greenchair•4h ago
Nothing is well regarded on HN so that's fine.
esafak•2h ago
It's a lumbering framework like Django. People opt for lighter and simpler these days.
rapidaneurism•4h ago
How do you pass a user token to MCP calls? Do you hand the token to the LLM and expect it to fill an argument?
theblazehen•4h ago
Usually via environment variables in the MCP server definition, or a config file
_moog•1h ago
I recently started diving into LLMs a few weeks ago, and one thing that immediately caught me off guard was how little standardization there is across all the various pieces you would use to build a chat stack.

Want to swap out your client for a different one? Good luck - it probably expects a completely different schema. Trying a new model? Hope you're ready to deal with a different chat template. It felt like every layer had its own way of doing things, which made understanding the flow pretty frustrating for a noobie.

So I sketched out a diagram that maps out what (rough) schema is being used at each step of the process - from the initial request all the way through Ollama and an MCP server with OpenAI-compatible endpoints showing what transformations occur where.

Figured I'd share it as it may help someone else.

https://moog.sh/posts/openai_ollama_mcp_flow.html

Somewhat ironically, Claude built the JS hooks for my SVG with about five minutes of prompting.

youdont•1h ago
Have you tried BAML? We use it to manage APIs and clients, as well as prompts and types. It gives great low level control over your prompts and logic, but acts as a nice standardisation later.
_moog•1h ago
That's going to be super useful for some of the high-level prompt-testing work I'm doing. Thanks!

I'm also getting more into the lower-level LLM fine-tuning, training on custom chat templates, etc. which is more of where the diagram was needed.

OpenCut: The open-source CapCut alternative

https://github.com/OpenCut-app/OpenCut
20•nateb2022•29m ago•7 comments

How does a screen work?

https://www.makingsoftware.com/chapters/how-a-screen-works
256•chkhd•7h ago•60 comments

Five companies now control over 90% of the restaurant food delivery market

https://marketsaintefficient.substack.com/p/five-companies-now-control-over-90
61•goinggetthem•1h ago•25 comments

Show HN: A Raycast-compatible launcher for Linux

https://github.com/ByteAtATime/raycast-linux
107•ByteAtATime•4h ago•24 comments

A technical look at Iran's internet shutdowns

https://zola.ink/blog/posts/a-technical-look-at-irans-internet-shutdown
63•znano•4h ago•22 comments

APKLab: Android Reverse-Engineering Workbench for VS Code

https://github.com/APKLab/APKLab
5•nateb2022•29m ago•0 comments

Reading Neuromancer for the first time in 2025

https://mbh4h.substack.com/p/neuromancer-2025-review-william-gibson
328•keiferski•13h ago•292 comments

The Gottorf Globe and its reconstruction

https://gottorfer-globus.de/en/the-gottorf-globe
10•Archelaos•2h ago•2 comments

GLP-1s Are Breaking Life Insurance

https://www.glp1digest.com/p/how-glp-1s-are-breaking-life-insurance
164•alexslobodnik•3h ago•197 comments

Does showing seconds in the system tray actually use more power?

https://www.lttlabs.com/blog/2025/07/11/does-showing-seconds-in-the-system-tray-actually-use-more-power
102•LorenDB•4h ago•91 comments

The North Korean fake IT worker problem is ubiquitous

https://www.theregister.com/2025/07/13/fake_it_worker_problem/
102•rntn•9h ago•88 comments

C3 solved memory lifetimes with scopes

https://c3-lang.org/blog/forget-borrow-checkers-c3-solved-memory-lifetimes-with-scopes/
68•lerno•2d ago•58 comments

Show HN: Learn LLMs LeetCode Style

https://github.com/Exorust/TorchLeet
93•Exorust•8h ago•10 comments

Fine dining restaurants researching guests to make their dinner unforgettable

https://www.sfgate.com/food/article/data-deep-dives-bay-area-fine-dining-restaurants-20404434.php
29•borski•6h ago•61 comments

Infisical (YC W23) Is Hiring DevRel Engineers

https://www.ycombinator.com/companies/infisical/jobs/qCrLiJb-developer-relations
1•vmatsiiako•4h ago

How to scale RL to 10^26 FLOPs

https://blog.jxmo.io/p/how-to-scale-rl-to-1026-flops
18•jxmorris12•3d ago•0 comments

Axon's Draft One AI Police Report Generator Is Designed to Defy Transparency

https://www.eff.org/deeplinks/2025/07/axons-draft-one-designed-defy-transparency
183•zdw•2d ago•121 comments

Hungary's oldest library fighting to save 100k books from a beetle infestation

https://www.nbcnews.com/world/hungary/hungary-pannonhalma-archabbey-beetle-infestation-rcna218539
55•rntn•3h ago•18 comments

The upcoming GPT-3 moment for RL

https://www.mechanize.work/blog/the-upcoming-gpt-3-moment-for-rl/
158•jxmorris12•4d ago•60 comments

Are a few people ruining the internet for the rest of us?

https://www.theguardian.com/books/2025/jul/13/are-a-few-people-ruining-the-internet-for-the-rest-of-us
14•pseudolus•53m ago•8 comments

Local Chatbot RAG with FreeBSD Knowledge

https://hackacad.net/post/2025-07-12-local-chatbot-rag-with-freebsd-knowledge/
50•todsacerdoti•7h ago•3 comments

The Robot Sculptors of Italy

https://www.bloomberg.com/features/2025-robot-sculptors-marble/
41•helsinkiandrew•3d ago•8 comments

Holographic ribbon aims to oust magnetic tape with 50-year life span and 200TB

https://www.tomshardware.com/pc-components/storage/holographic-ribbon-aims-to-oust-magnetic-tape-with-50-year-life-span-and-200tb-capacity-per-cartridge-holomem-says-optical-ribbon-based-carts-work-with-some-components-of-existing-systems-reducing-fricition
15•freddier•1h ago•7 comments

Boxtype–Devlog (Part 1)

https://inconvergent.net/2025/boxtype-devlog/
4•surprisetalk•3d ago•0 comments

Notes on Graham's ANSI Common Lisp (2024)

https://courses.cs.northwestern.edu/325/readings/graham/graham-notes.html
81•oumua_don17•3d ago•28 comments

Monitoring My Homelab, Simply

https://b.tuxes.uk/simple-homelab-monitoring.html
75•Bogdanp•3d ago•28 comments

Understanding Tool Calling in LLMs – Step-by-Step with REST and Spring AI

https://muthuishere.medium.com/understanding-tool-function-calling-in-llms-step-by-step-examples-in-rest-and-spring-ai-2149ecd6b18b
72•muthuishere•11h ago•20 comments

The Decipherment of the Dhofari Script

https://www.science.org/content/article/mysterious-pre-islamic-script-oman-finally-deciphered
51•pseudolus•11h ago•17 comments

Prompt Engineering: From Zero to Hero

https://promptz2h.com/
8•blackpc•4h ago•2 comments

Bypassing Google's big anti-adblock update

https://0x44.xyz/blog/web-request-blocking/
938•deryilz•1d ago•812 comments