Skip to content

Conversation

ant-ms
Copy link

@ant-ms ant-ms commented Aug 13, 2025

The README reads as follows:

DJANGO_MCP_GET_SERVER_INSTRUCTIONS_TOOL (default=True) if true a tool will be offered to obtain global instruction and tools will instruct the agent to use it, as agents do not always have the MCP server glboal instructions incldued in their system prompt.

However, I could not find any such functionality in the whole codebase. Maybe it was forgotten? If I just missed, it somehow, please let me know and close this PR.

This PR fixes this by checking the DJANGO_MCP_GET_SERVER_INSTRUCTIONS_TOOL variable and if it is set to True (which it is by default) it will create a "get_server_instructions" tool which returns the server instructions, just like the README indicates.

As a result the agents will check this tool before doing anything:

image

PS. I could not find any contribution guidelines in this project, let me know if I missed something and I'll adapt.

@nejch
Copy link

nejch commented Sep 18, 2025

Hey @omarbenhamid just checking in on this PR as it would help us get server-wide instructions deployed. Is this project still actively maintained after the initial implementation? Thanks and sorry for the ping 🙇

@omarbenhamid
Copy link
Owner

Hello,

Thanks for the reminder.

The global instructions have been abandoned as most agents (by the time) needed to be explicitly hinted to read them, and they did not do by default.

@ant-ms the PR seems ok except for the error handling : by default the good practice is to let the exception raise up.

Sorry for the random maintainance issue : it is easier when client projects give me time on, but it gets tighter when no projects have requirements on the topic.

@ant-ms ant-ms force-pushed the fix/implement-server-instructions-tool branch from 02741e6 to 5f85903 Compare September 18, 2025 13:37
@ant-ms
Copy link
Author

ant-ms commented Sep 18, 2025

@omarbenhamid Thanks a ton for your time, I appreciate it.

The global instructions have been abandoned as most agents (by the time) needed to be explicitly hinted to read them, and they did not do by default.

I guess some of the models have gotten better. Testing this locally in our projects, the newer/smarter models seem to, mostly reliably (around 80% of the time), call the tool as instructed, and most of the ones that didn't succeed at first, query it after failing another tool call.

This is still not a perfect score of course, but I suspect, that as models continue to get better this will improve. The alternative would be to say that this score is not good enough to be upstream, in which case I would suggest removing this feature from the docs too to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants