INQUIRING LINE

Should an AI write a script to get the job done, or pick and call tools live, step by step?

Can code generation substitute for dynamic function calling in production workflows?

This explores whether having an LLM write code (scripts, workflows, reusable skills) can take the place of letting it pick and call tools on the fly while a production task runs, and what the corpus says about which approach holds up when reliability matters.


This explores whether having a model write code can replace letting it choose and call tools live, mid-task, in real deployed systems. The corpus has no head-to-head comparison between the two. Several notes do point the same way, though. In production, the problem is less about code versus function calls and more about **where the non-determinism sits**. Both approaches work best when the model's freedom is confined to a step that can be checked.

The sharpest evidence comes from teams who removed dynamic tool selection altogether. In one production case, routing tools through a protocol layer (MCP) caused unpredictable failures: the model picked the wrong tool or guessed parameters. Determinism came back only after switching to explicit direct function calls with a single tool per agent Why do protocol-based tool integrations fail in production workflows?. The same note cites a survey in which 85% of production teams build custom agents instead of using frameworks. The lesson isn't that function calling is bad. It's that letting the model *decide at runtime* which function to call is the fragile part.

Code generation is one way to move that decision somewhere safer. FlowMind has the LLM write a workflow that calls a set of vetted APIs, and a human can inspect it before it runs. The model never touches proprietary data directly Can LLMs generate workflows without touching proprietary data?. The generated code works as a plan you can read and audit before anything executes. A dynamic call sequence happens one step at a time, and you only see it afterwards. A related idea treats code as stored, reusable capability instead of something written once. Code2Skill extracts over a million verifiable skills from GitHub repositories, and these beat skills learned from agent trajectories Can source code replace experience as skill raw material?. MUSE-Autoskill has the agent write new skills inside its own reasoning loop, so each skill is checked against the real task context as it's created Does creating skills inside the agent loop eliminate mismatches?. Both suggest a hybrid: code becomes the toolbox, and runtime calls just pick from tested pieces.

One note makes a surprising case for handing work to external code. Autoregressive models can't take back tokens they've already emitted, which constraint solving requires. So pairing a model with a symbolic solver works because it supplies a capability the architecture lacks, not just extra speed Why does autoregressive generation fail at constraint satisfaction?. Some jobs should be generated code or external programs simply because the model can't do them reliably in-line.

On the other side, function calling keeps getting cheaper to do well. Small models trained with DPO on correct and incorrect examples from a large teacher can match large models on function calling. The explicit wrong examples help most with the strict output-format errors that ordinary fine-tuning leaves behind Can small models match large models on function calling?. So the realistic answer is not substitution. Generated code works well as an inspectable, testable layer of workflows and skills. Narrow, deterministic function calls are still the right way to run them. The corpus doesn't yet measure where one approach clearly wins over the other.


Sources 6 notes

Why do protocol-based tool integrations fail in production workflows?

MCP integration caused non-deterministic failures through ambiguous tool selection and parameter inference. Replacing it with explicit direct function calls and single-tool-per-agent design restored determinism. A 306-practitioner survey confirms 85% of production teams build custom agents, forgoing frameworks.

Can LLMs generate workflows without touching proprietary data?

FlowMind demonstrates that LLMs can generate on-the-fly workflows for spontaneous tasks by orchestrating calls to vetted APIs rather than accessing data directly, eliminating confidentiality risks while maintaining high-level human inspection and feedback.

Can source code replace experience as skill raw material?

Code2Skill extracts over 1 million auditable skills from GitHub repositories through source-blind reconstruction verification, improving performance from 42.90 to 47.90 macro-average across eight benchmarks, outperforming trajectory and document-derived alternatives.

Does creating skills inside the agent loop eliminate mismatches?

MUSE-Autoskill demonstrates that invoking skill creation from within the agent's reasoning loop grounds new skills in exact task context, immediate feedback, and runtime validation. In-loop skills reach 87.94% task accuracy and transfer to other agents with minimal loss, eliminating the situated context problem of offline authoring.

Why does autoregressive generation fail at constraint satisfaction?

The performance ceiling on constraint satisfaction problems is not a model-quality issue but an architectural limitation: autoregressive transformers cannot retract emitted tokens, while CSP solvers fundamentally depend on discarding invalid partial assignments. Symbolic solver integration works because it supplies what the architecture lacks.

Show all 6 sources
Can small models match large models on function calling?

Small models fine-tuned via DPO on correct and incorrect function-calling examples from a large teacher model achieve high accuracy on logical and mathematical tasks. DPO's explicit negative examples directly target the rigid output format failures where SFT alone underperforms.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.