Agentic AI for Developers Starts With a Bounded Tool
Agentic AI moves tool selection from your code to the model; I'd start with a bounded log reader, explicit permissions, and tests for failed calls.
- Topic
- AI
- Reading time
- 8 min
- Length
- 1,748 words
- Published
- Nov 11, 2026
09:11 pm IST
In this article
Agentic AI for developers starts with a change in who picks the next step. Instead of suggesting actions, the model chooses tools, reads what comes back, and decides what to do next. I no longer have to keep carrying answers between a chat window and my application. I delegate that loop instead, ideally for a task with a tight boundary around it.
The move from chat to tool-driven agents interests me less than the boundary around those tools. I'd start with an agent that can inspect selected application logs. Not one that can deploy a fix. That gives me something useful to evaluate without making write access the price of trying it out.
How is an agent different from a chatbot or workflow?
With a chatbot, execution stays with me. It proposes a command or an interpretation; I decide whether to act on it. A workflow puts execution into code, but that code still fixes the sequence. An agent hands a different decision to the model: which operation to try next, and whether the tool results justify continuing.
I find that distinction more useful than a product label. If a sequence always retrieves a document and then summarizes it, it can stay a workflow. I'd consider an agent when the next useful action really depends on what an earlier action discovers. If I can comfortably express and test the branch myself, I don't see a reason to hand that choice over.
Agentic AI involves autonomous planning and action, with a distinction between individual agents and a broader system that coordinates multiple agents. The developer-oriented definition also includes a single model running a tool loop. I'd spell out that terminology in a design review. A bounded agent does not need a whole cast of specialized agents to justify its existence.
Generative AI creates content: text, images, or code. Agentic systems use model capabilities to take actions toward a goal. For me, generating a debugging explanation is one responsibility; deciding which log to inspect is another. The same model can participate in both, but I still want to treat those responsibilities separately.
Delegation changes the production question
The figures in Anthropic's June 2026 Economic Index report make the interaction change concrete: the median chat or Cowork conversation producing a blog post involved 13 rounds, while the median Claude Code session for that task contained a single human prompt. I'd read that as evidence of delegated interaction. I would not read it as proof that the output needed no review.
That changes what I need to inspect. With a fixed workflow, I can review the intended path before execution. With an agent, I also need to understand the path it actually chose. Autonomy brings higher costs and potentially compounding errors, both identified in Anthropic's guidance. I'd therefore put the tool sequence in my acceptance criteria, alongside the final answer, rather than treating it as an implementation detail.
I work on AI-assisted editorial workflows in a newsroom CMS, and I'd keep summarization separate from permission to change publishing state. A useful explanation of a failure would not, on its own, persuade me to let the same agent republish content. That's a judgment about the design I want, not an argument that agents have no place in it.
I'd start the review with the request and its allowed effects, much as I approach AI system design. What outcome am I permitting? I'd want that settled before choosing an agent framework. Starting with the framework would put those decisions in the wrong order.
Building a bounded MCP log reader
The Model Context Protocol exposes tools through a server, which an MCP client can discover and call. For my first experiment, I'd keep the server's contract narrow: list permitted log files and return a bounded tail of one file. That's the whole job. No repair commands, no deployment action, and no arbitrary file reader tucked into the same interface.
This Python example uses the SDK version 2 interface, including MCPServer, and the installation command uses the CLI extra. I'd check which dependency version actually resolved before using the example. I wouldn't mix this code with older tutorials that import mcp.server.fastmcp and assume the interfaces match.
python3 -m venv .venv
. .venv/bin/activate
pip install "mcp[cli]"
Save the following as log_reader.py. The tool's reassuring name isn't the control I care about here. The resolved-path check is:
"""A read-only MCP server: an agent may read your app's recent log lines, and nothing else."""
import os
from collections import deque
from pathlib import Path
from mcp.server import MCPServer
from mcp.server.mcpserver.exceptions import ToolError
from mcp.types import ToolAnnotations
# The one folder this server reads. Nothing outside it, nothing that isn't a .log file.
LOG_DIR = Path(os.environ.get("LOG_DIR", "./logs")).resolve()
MAX_LINES = 200
mcp = MCPServer("log-reader")
def _allowed(path: Path) -> bool:
real = path.resolve() # follows symlinks and "..", so neither can leave LOG_DIR
return real.parent == LOG_DIR and real.suffix == ".log" and real.is_file()
# Hints for the client: these tools change nothing and reach nothing outside LOG_DIR.
READ_ONLY = ToolAnnotations(read_only_hint=True, open_world_hint=False)
@mcp.tool(annotations=READ_ONLY)
def list_logs() -> list[str]:
"""List the .log files the agent is allowed to read."""
return sorted(p.name for p in LOG_DIR.glob("*.log") if _allowed(p))
@mcp.tool(annotations=READ_ONLY)
def tail_log(name: str, lines: int = 50) -> str:
"""Return the last `lines` lines (1 to 200) of one file from list_logs."""
path = LOG_DIR / name
if not _allowed(path):
raise ToolError(f"{name!r} is not a .log file in {LOG_DIR}")
lines = max(1, min(lines, MAX_LINES))
with path.resolve().open(encoding="utf-8", errors="replace") as f:
return "".join(deque(f, maxlen=lines))
if __name__ == "__main__":
mcp.run(transport="stdio")
The code resolves the path before checking its parent directory and suffix. That rejects both a parent-directory escape and a symlink pointing outside the permitted folder. The equality check is deliberate, too: access is limited to files directly inside that folder. It does not accept the entire directory tree beneath it.
The requested line count gets clamped. A rejected file request becomes a ToolError, so the model can read it as a failed call. The tool annotations describe the intended read-only behavior, but they're hints. They don't enforce it. I'd read the actual file-access code before trusting what those annotations appear to promise.
Connecting the log reader without widening its authority
Claude Code can register this local server at project scope with the command below. That scope writes the entry to .mcp.json, so the repository can carry the configuration rather than leaving it outside the project:
claude mcp add --env LOG_DIR=./logs --transport stdio --scope project log-reader -- .venv/bin/python log_reader.py
I'd keep the argument order exactly as shown. The environment option belongs before the server name; everything after -- is the command that starts the server. Before approving a project-scoped server, I'd inspect both pieces: the configuration entry and the executable that entry will start.
Claude Code asks for approval before using a project-scoped server. Once inside a session, I can check its connection state with /mcp. After verifying that connection, I'd use the following .claude/settings.json to permit the log tools while denying the specified push command and direct environment-file read:
{
"permissions": {
"allow": [
"mcp__log-reader__list_logs",
"mcp__log-reader__tail_log"
],
"deny": [
"Bash(git push *)",
"Read(./.env)"
]
}
}
Deny rules take precedence over ask and allow rules. Claude Code enforces them; enforcement isn't left to the model. Command matching still has gaps, though. A denial targeting Bash(curl *) does not stop an equivalent request made through sh -c. I'd use this settings file as a permission layer, but I wouldn't mistake it for a complete isolation policy.
Testing the log reader before handing it real logs
I'd start with a dedicated folder of synthetic logs and test the boundary first: a permitted file, a non-log file, a parent-directory request, and a symlink leading somewhere else. Then I'd try a missing file and an excessive requested line count. Useful output is only half the test. I also want refusal to be predictable.
After that, I'd give the agent a bounded investigation prompt: inspect the available logs, identify relevant failures, and explain the evidence without changing anything. I'd compare the final explanation against the lines the tools returned. A guessed cause that the evidence doesn't establish is an evaluation failure for me, even if every tool call stayed within its permissions.
For the newsroom application, I'd use fictional publishing failures before exposing operational data. I'd look for two things in the review: does the agent distinguish an observed error from an inferred cause, and does it stop when the available logs cannot resolve the question? I want the uncertainty left in the answer, not polished out of it.
Before expanding the experiment, I'd record the attempted calls, the refusals, and the final result. Then I'd compare that investigation with a fixed retrieval workflow. The question for me is whether dynamic tool selection adds useful coverage. If the agent keeps following the same path, I'd rather encode that path directly than keep delegating a decision that doesn't vary.
Read-only access does not settle data exposure or correctness
This example bounds the number of returned lines. It does not bound the total characters in those lines, so I wouldn't call it a complete output-size budget. Before pointing it at unfamiliar logs, I'd decide whether the tool also needs a byte limit. I'd also decide what it should do when it reaches that limit.
I'd review the contents of the permitted folder as a separate decision. Read-only access still exposes whatever the tool returns to the model. My preference is a deliberately prepared log view, not access to a convenient directory merely because that directory already exists. The same distinction matters in read-only MCP audits. No write permission is useful, but it answers only one part of the review.
I value the resolved-path check, but I wouldn't present this small example as a hardened filesystem sandbox. If another process could change files during access in a deployment, I'd request a separate filesystem-isolation review. I'd set an outer execution budget as well. Returning a short tail doesn't settle how many calls the agent is allowed to attempt.
My default is still a workflow when I know the steps. I'd choose an agent when variable investigation paths justify the extra evaluation and permission work, and a bounded log reader gives me a sensible place to test that choice because its authority is visible. Greater autonomy alone isn't the upgrade I'd ship. I'd want useful delegation with limits I can explain and verify; for this reader, that means checking the attempted calls, refusals, and evidence before widening the experiment.
Sources
This is the source this article is based on. Many articles on this blog are drafted with AI and checked against their source automatically; the editorial policy explains how, and how to report a mistake.
Frequently asked
Do I need MCP to build an AI agent?
MCP provides an interface for discovering and calling tools; the defining agent behavior is the model choosing actions and next steps. I'd use MCP when that tool interface fits the client, rather than treat it as what makes a system agentic.
Should I replace an existing AI workflow with an agent?
I'd keep the workflow if its steps are already known and testable. I'd evaluate an agent when earlier results genuinely change which action should come next, and compare its output and tool sequence against the existing approach.
Are read-only MCP tools safe to approve automatically?
I would not approve them based on annotations alone. The annotations are hints; I'd inspect the enforced access boundary, the information returned, and the client permissions before allowing unattended reads.
Weekly newsletter
Liked this? Get the next one by email
One short email a week with new articles on React, Node.js, TypeScript and AI engineering. No spam. Unsubscribe in one click.
Further reading
Related tutorials from ByteMuni, my developer publication.
- LLMs & Generative AIAI System Design Explained: How ChatGPT-Style Apps Are Built, from Students to Experts (2026 Guide)AI system design is the craft of building everything around an AI model so the product is fast, affordable, reliable and safe. This guide follows one request through a real AI system, covering gateways, guardrails, caching, routing, RAG, agents, MCP, inference, KV cache, continuous batching, evaluation and cost. It includes real calculations, a batching simulation, a worked cost estimate for 2 million students and an interview framework.
- Developer ToolsREA Setup Guide: Reverse Engineer Any App With Your AI Coding AgentREA lets your coding agent reverse engineer apps with Ghidra, Hopper and IDA. Here’s how to set it up in ten minutes, run your first investigation, and use it responsibly.
- AI & Machine LearningAgent Harness vs MCP: How the AI Agent Stack Fits Together An agent harness runs the loop; MCP is the standard plug it uses to reach tools and data. This explainer maps all seven layers of the AI agent stack and traces one real request through each.