I can’t figure out how to ask LLM to write an up-to-date LangChain script with the latest docs

Whenever I ask claude or chatgpt to write me a simple langchain agent - even the very simple ones - it always gives me a script with outdated libraries. I tried using claude with context7mcp and langchain docs mcp - still i get out of date obsolete script with deprecated libraries.

The general observation is that if i use claude code with context 7 MCP and ask it to write a a simple agent with Langchain it gives me a script most of the time with outdated versions and libraries. Same with chatgpt. So it’s becoming extremely difficult to just test out a feature.

How do you suggest I approach this problem

Hi @gowthamraj500

What model are you using for that?
Do you instruct your agent to use the mcp from context7?

You can still utilize this Use docs programmatically - Docs by LangChain

Hello Pawel, yes i have used context 7 MCP and lang chain docs MCP but still no effect. I have added them both to my claude code globally. Still I get very old and deprecated code

ok. what about the other two questions?