Zero Labs
Industry News / AI

My Travel Planner Decided I Love Taxis

Source · Towards AI By Sahar Darafsh

From the publisher’s feed, collected in the ZeroLabs newsroom.

A weekend prototype of an MCP travel planner in Python (SQLite, local vector search, a planner prompt), and the 11 flaws it showed me.Image generated by AII’m going to Porto in May. So I tried every planning app I could find, and they all gave me the same lists, written for a visitor who isn’t me.The things that really matter to me weren’t in any of them. Which cafés I loved in Sicily. Which museum in Vienna bored me. How much I like to fit into one day. None of it was written anywhere a program could read. It lived in my head and in my photo roll.I also wanted to learn MCP and RAG properly, and the best way I know to learn something is to build a thing I’ll actually use. So the project became a planner that saves my trips, searches my own travel notes, and plans a day around what I like, with Claude as the interface.I built the prototype over a weekend, in three parts. I’ll call them Day 1, 2 and 3 below, and each one adds a layer. And yes, by the end, it had decided I love taxis. We’ll get there.The whole thing on one screenThere’s no web app yet. Claude Desktop is the whole interface. Everything else is one Python process plus two data stores on my laptop: SQLite for the trips and a local Chroma vector store for the notes.Chart generated by Excalidraw and authorEach day added one layer: the trip tools on Day 1, the notes search on Day 2, the profile and the planner prompt on Day 3.All my personal data lives in one data/ folder that git ignores: the database, the notes, the vector store and the profile. One ignore rule covers all four, so none of my travel notes can end up in the repo by accident.Day 1: a server Claude can talk toThis prototype only runs on my laptop, so I used stdio, the simplest transport. Claude Desktop starts my server as a child process. Claude writes requests to the server’s stdin, and the server writes its answers to stdout. Each message is one line of JSON-RPC.That has one big side effect: stdout belongs to the protocol, and only to the protocol. Anything else written there gets parsed as a message, fails, and breaks the connection. Even a single forgotten print() could do it. So I used Python’s logging module to send all logs to stderr. Claude Desktop saves them in a log file for each server (%APPDATA%\Claude\logs\mcp-server-travel-planner.log on Windows), and that file is where I did most of my debugging.Old tutorials don’t run anymoreIf you’re following along, this one will save you some confusion. Most MCP tutorials I found begin with from mcp.server.fastmcp import FastMCP. With the current SDK, that line fails right away with ModuleNotFoundError. Version 2.0, released in July 2026, renamed the class to MCPServer:from mcp.server import MCPServermcp = MCPServer("travel-planner")So if an example breaks on the very first line, check which SDK version it was written for, before you start doubting yourself. 🙃The function signature is the API contractHere’s a nice shortcut: the code I write anyway is also the contract Claude reads. I didn’t write a single schema by hand. The SDK reads my Python function and builds the tool from it. The function name becomes the tool name, the docstring becomes its description, and the type hints become a JSON Schema for the arguments.@mcp.tool()def create_trip( destination: str, start_date: str, # YYYY-MM-DD end_date: str, travel_type: Literal["relaxed", "packed"] = "relaxed", budget: int | None = None, currency: str = "EUR",) -> dict: """Save a new trip and return it exactly as stored."""For the travel type I used Literal. In the schema it becomes an enum, so Claude sees the two allowed values before it ever calls the tool. The default shows up in the schema too.The decorator registers the tool as soon as the module is imported. That’s why the mcp object and all the tools sit at the top level of the file. Inside a function, they would only be registered if that function ran, and Claude might never see them.Small data decisions with big effectsThese look like tiny details, but each one prevents a quiet bug.Surrogate ids. Every trip gets an INTEGER PRIMARY KEY. Claude calls list_trips, copies the id and passes it to get_trip. That’s safer than asking it to retype the destination and date exactly and use them as the key.ISO dates as text. 2027-05-01 sorts correctly as plain text, so ORDER BY start_date works without a date type. 01.05.2027 would compare the day first and sort wrong. I’m not happy keeping dates as strings, but SQLite has no real date type, and for a prototype it’s enough. In the rebuild with Postgres, they’ll be proper DATE columns.Lists as JSON stored as text. Interests go in with json.dumps and come out with json.loads. If there are no interests, the column stays NULL. It doesn’t hold the text “null”, which is what json.dumps(None) would give, and which would look like real data.Errors are messages to ClaudeThis one changed how I think about errors. When a tool fails, Claude reads the error as the tool’s answer, and then decides what to do next. So I wrote my errors as next steps:No trip with id 7. Run list_trips and find the correct trip_id.The tool name in the message has to match the real tool exactly, or the hint sends Claude to a tool that doesn’t exist. Having no trips is a different case, and it isn’t an error at all. list_trips just returns [], because “no trips yet” is a valid answer.Testing before ClaudeBefore connecting the server to Claude Desktop, I tested all three tools in the MCP Inspector (npx @modelcontextprotocol/inspector), including the not-found error.At the end of Day 1, I created a packed Porto trip, with food and viewpoints as interests, just by writing a chat message. No form to fill in: I described the trip in normal words, and Claude turned it into a create_trip call with the right arguments. list_trips returned all my trips, sorted by start date. Claude could now save and read my trips. Next, it had to learn what I actually like.Day 2: search over my own notesThis is the RAG part: find the notes that fit a question, then let Claude write the answer from them. First, though, the notes had to exist.Writing the memory downI wrote notes for three past trips. My first drafts were messy. They still had template placeholders like “Some Viewpoint” and “Café Example”, and some sections described three places at once.The final format is one Markdown file per trip. The front matter describes the trip, and every place gets its own ## section with the same fixed fields (sample data):---trip: Vienna 2025city: Viennacountry: Austriatravel_type: relaxed---## Café Lindenhoftype: cafecity: Viennaverdict: lovedrating: 5why: Quiet in the morning, good strudel.tip: Sit in the back room.type and verdict use closed lists (loved, liked, disliked, hated for the verdict), so they can work as filters later.Chunking: one place, one vectorThe pipeline is simple: an ingest script reads the Markdown notes, splits them into chunks, embeds them and stores them in Chroma. It splits each file at the ## headings, so one chunk is one place. A chunk’s text is the heading plus its fields. Its metadata is the front matter, the source file and the section name. Three notes gave 14 chunks.I rejected two other options:One vector per file. The embedding model reads about 256 tokens and cuts off the rest. Even within that limit, one vector for five places is an average that matches none of them well.Fixed-size windows with overlap. They cut a place in half, and half a place is a poor source to cite.Ingestion is its own script, and I run it whenever the notes change. The server only reads from the store and never re-chunks on startup.Ids that survive a re-runEvery time the ingest script runs, it has to recognize which chunk is which, so it updates the old ones instead of adding copies. That all depends on the ids.Each chunk id is the file stem plus a slug of the heading, for example vienna-2025#cafe-lindenhof. Same note, same id, so upsert updates the chunk in place. The other options all break somewhere:Random UUIDs are new on every run, so every run would add duplicates.List positions shift as soon as I add a place.A content hash changes with every edit.upsert never deletes, though. If I rename a heading, the old chunk stays behind, and the search can then cite a place that is no longer in my notes. So before each ingest run, a set difference finds those orphans:existing = set(collection.get(include=[])["ids"])current = {chunk["id"] for chunk in chunks}orphans = sorted(existing - current)if orphans: collection.delete(ids=orphans)There’s a trap hidden in that code. If chunks were ever empty, every stored id would count as an orphan, and the whole store would be wiped. So the loader raises an error when the notes folder is missing or has no .md files.Two type problems came up as well. YAML turns an unquoted date into a Python date, but Chroma metadata only accepts str, int, float and bool. So a small converter turns dates into ISO strings, joins lists with commas and drops None.The last surprise was invisible. Some editors save a byte order mark at the start of the file, and then the front matter is silently not found. Reading the files with encoding=”utf-8-sig” fixed it.The bug that showed me what gets embeddedFinally, the real test. I asked Claude, “What did I love in Sicily?”The results were notes from Vienna. 🤦🏻‍♀️It took me a moment to see why. The country was only in the front matter, which Chroma stores as metadata. But only the chunk text goes through the embedding model. So for the vector search, my Sicily cafés were just cafés.The fix was a Country: line in the text of every chunk, built once per file from the front matter. It took three tries. My first version wrote the literal text {country} into every chunk. A quick fix would have written None for notes without a country, and Python list syntax like [‘Italy’] when the country is a list (some trips cover more than one country). The final version joins lists with a comma and skips the line when the country is missing.Topic is easy, opinion is hardNext question: “What did I like in Vienna?” It returned every Vienna chunk, with L2 distances between 0.70 and 0.81 (lower means closer). There was no gap between what I liked and what I didn’t. The ## Overall chunk is the one section of a note that isn’t about a single place. It scored weakest of all, at 0.965, because its text named no place.The embedding captures what a text is about much better than how I felt about it. A Vienna café I loved and a Vienna café I didn’t like end up almost in the same spot.The answer was still right, because Claude read the verdict and rating lines in the results and sorted them itself. For the rebuild, “what did I like” becomes a metadata filter on verdict, and the vectors only handle the topic.The tool around itsearch_my_travel_memory returns a list of dicts with id, text, source, section, city and the distance rounded to three decimals. source and section are what Claude cites, so I can check where an answer came from. The docstring tells Claude when to use the tool, that a lower distance means a closer match, and to say so when nothing relevant comes back.An empty store raises an error telling Claude that the ingest script needs to run. Why not just return an empty list? Because an empty list would read as “you have no relevant memories”, and Claude would answer as if that were true.In Claude Desktop, Claude picked the number of results on its own (8). It also handled my typo “Sicly” without any help. 😁So Claude could save my trips and search my memories. The last step was turning all of that into an actual plan.Day 3: the plannerMCP gives a server three ways to expose things. The difference is who decides when they get used:Tool: the model decides, during the conversation. In this project: create_trip, get_trip, list_trips, search_my_travel_memory.Resource: the app or the user attaches it as context. In this project: profile://me, my preference profile.Prompt: the user picks it from a menu. In this project: plan_day.Profile as a resourcedata/profile.json holds my defaults, the things that rarely change: pace, when my day starts and ends, a fallback budget, food I like and avoid, interests, and things to skip. The server reads the file on every call, so my edits apply without a restart.When a trip and the profile disagree, the trip wins. My profile says relaxed, the Porto trip says packed, and the plan came out packed.plan_day as a promptIn Claude Desktop, I pick plan_day from the prompt menu and fill in two arguments: trip_id and day. The server loads the trip through get_trip, reads the profile, and puts both into the prompt text. The memory search, on the other hand, stays a tool, so Claude decides what to look up while it plans, instead of me guessing in advance which notes matter. I checked that it really called search_my_travel_memory during planning.The prompt also asks for a source tag on every reason, so I can see where each idea came from (sample output):- Morning: a quiet café before sightseeing [memory: vienna-2025#cafe-lindenhof]- Lunch: grilled fish, skip the set menus [profile]- Evening: sunset from a viewpoint [general knowledge]Reading the plans closelyI ran the prompt twice: once for a day that turned out to fall outside the trip’s dates, and once for day 2. Both plans looked good at first glance. On a careful read, they had problems. These are the ones that stood out:A day outside the trip. Claude noticed that this day wasn’t part of the trip and said so. Then it planned day 1 anyway, without asking me.A local fact became a rule about me. My Sicily note says a taxi app was easier there. For Porto, the planner concluded that I prefer taxis. And that’s how my travel planner decided I love taxis. 🚕Over budget. The plan’s own estimate was above the daily budget I had set.Missing context. It ignored the hotel breakfast and guessed the travel time between stops. Opening hours and prices all said “check”.The wrong shape. It gave me an hour-by-hour timetable. That’s not how I travel. I travel with a list of options grouped by area, with a note on how to get there.Gone after the chat. The plan wasn’t saved anywhere.Eleven flaws, four causesI wrote down every flaw I found in the plans. There were 11, and they all came from just four causes:Missing data. The planner didn’t know my hotel includes breakfast, so it ignored it.Missing tools. It had no way to check travel times or opening hours, so it guessed.The model doing code’s job. It went over my budget because nothing calculated the prices.One trip turned into a rule. A taxi app was easier in Sicily, so it decided I prefer taxis everywhere.The third cause changed my plan the most. Checking a budget or a date is a job for code, not for a language model. Code does the same math the same way every time, while a model writes what a good answer would probably look like. So in the rebuild, code makes those decisions and Claude explains them.For the fourth cause, I now separate two kinds of memory:What happened on one trip: “In Sicily, the taxi app was easier than the bus.”What is true for me: “I take a taxi when public transport is bad.”A trip memory only becomes a preference if it happens again on another trip, or if I say so myself.What I’m taking into the rebuildThe environment costs more time than the code. Encodings, relative paths, environment variables and config reloads took longer than writing any of the tools.Know what gets embedded. Metadata filters results, and only the text decides similarity. Anything the search should match on has to be in the text. Sicily taught me that one.Read the output like a reviewer. Both plans looked fine at first glance. The flaws only showed up when I went through them line by line.One experience is thin evidence. My planner turned one note about one city into a rule about me. People do the same with places and with each other, and building this made me notice it.What’s next?The prototype is done, and it did its job: it showed me where things break. Now I’m rebuilding it properly, keeping the parts that held up, in this order:Project structure, a linter and a formatterTests for the tools and the ingest logic, plus input validationA proper schema for places, hotels and itinerariesRAG with an evaluation set: hit rate at 5 on my own questions, compared against Claude with no memory at all. If the search doesn’t beat that baseline, I’ll drop it.A backend API and a website I can use on my phoneA planner where code scores and ranks the options, and Claude explains the resultLater articles will cover the evaluation set and the choice between pgvector and Qdrant.The Porto trip is still in May. By then, I’d like to plan it with my own notes instead of other people’s lists, and without a taxi waiting for me on every corner! 😄If you’ve built an MCP server or a RAG setup on personal data, which part gave you the most trouble?My Travel Planner Decided I Love Taxis was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.