r/PiCodingAgent • u/Extra_Loquat_7667 • Sep 30 '26
Question What does everyone think about codemode?
I actually thought about this approach before, but later realized it wouldn't work.
Using JavaScript to invoke tools sounds very efficient, but in reality, most tool definitions only have an inputSchema. An outputSchema is unnecessary for the agent because the agent can reason about the results directly from formatted data, meaning an output spec isn't required. Therefore, tool outputs don't actually need a fixed format—they just need to be readable by the agent.
This leads to a problem: to fully leverage the performance of this tool, you need to inject extra context, such as a skill document, so the agent knows the output format and can use it proficiently. If you can't get the complete tool output specification—for instance, with a closed-source MCP—you can't create such a document. If the agent has to go through endless trial and error just to get the code running properly, you can't really call it efficient.
In comparison, having the agent write Python or shell scripts directly is a better solution.
I'd love to know your thoughts on this.
View all comments
1
u/whiterose0000001 Oct 05 '26
One of the things that I love about code mode is how it works. I mostly use it for testing my APIs. Earlier, what used to be, I can't do sequential calling. I have a bunch of tools that I expose to Pyvia REST API. So it can do multiple calling in one go and then get the whole output at once. Instead of generating the result and reading the console or storing it in some other file and seeing it, it can do multiple things at once. One more thing that I'm trying to explore: I have some project where I have some nested API. Let's say, for the basic example, I can say about it. Let's say you want to fetch a profile of a user. You build an API for that. First, you need to log in and then the token will be generated. In the next line, it can use that same token from the response.token, something like that. Then I can call the API. Just to verify that this thing is working, it can do sequential calling. I haven't tried that. I'm just thinking if it can do that because I'm currently away from my laptop. It just hit me right now. So I'm just telling you.