-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Standardize README structure #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Update README to follow the standardized MCP README structure - Add badges (npm version, license) - Reorganize sections: Overview, Features, Installation, Configuration, Usage Examples - Add AUTO-GENERATED markers for MCP Tools section - Add generate-tools.mjs script for automatic tool documentation - Add sync-tools.yml workflow to auto-sync tool docs on push to main - Add zod-to-json-schema dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @Royal-lobster, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the project's documentation and developer experience by standardizing the README structure and automating the generation of tool documentation. These changes aim to provide a more consistent and easily maintainable overview of the MCP Discord server's capabilities, making it simpler for both new and existing users to understand and utilize the available tools. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request successfully standardizes the README structure and introduces an auto-generation workflow for MCP tool documentation. The generate-tools.mjs script effectively syncs tool definitions to the README, improving documentation consistency and maintainability. The addition of zod-to-json-schema dependency is also noted for future schema support.
| return `| \`${key}\` | ${type} | ${requiredStr} | ${description} |\n`; | ||
| } | ||
|
|
||
| function renderSchema(inputSchema) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const properties = inputSchema.properties; | ||
| const required = new Set(inputSchema.required ?? []); | ||
|
|
||
| if (Object.keys(properties).length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let table = hasDefaults | ||
| ? '| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table headers are hardcoded. Extracting these into constants or an array of strings would improve maintainability and make it easier to modify the table structure or content in one place.
const DEFAULT_HEADERS = '| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n';
const HEADERS_WITH_DEFAULT = '| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n';
let table = hasDefaults ? HEADERS_WITH_DEFAULT : DEFAULT_HEADERS;| md += `### \`${tool.name}\`\n`; | ||
| md += `${tool.description}\n\n`; | ||
| md += `${renderSchema(schema)}\n\n`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using md += ... inside a loop for string concatenation can be less efficient for a large number of iterations compared to collecting parts in an array and then joining them. While unlikely to be a performance bottleneck for README generation, it's a good practice for maintainability and potential future scalability.
function renderMarkdown(tools) {
const mdParts = [];
for (const tool of tools) {
const schema = tool.inputSchema;
mdParts.push(`### \`${tool.name}\`\n`);
mdParts.push(`${tool.description}\n\n`);
mdParts.push(`${renderSchema(schema)}\n\n`);
}
return mdParts.join('').trim();
}| if (!(readme.includes(START) && readme.includes(END))) { | ||
| throw new Error('README missing AUTO-GENERATED TOOLS markers'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message 'README missing AUTO-GENERATED TOOLS markers' is a hardcoded string. Consider defining this as a constant for better maintainability and consistency.
const MISSING_MARKERS_ERROR = 'README missing AUTO-GENERATED TOOLS markers';
function updateReadme({ readme, tools }) {
if (!(readme.includes(START) && readme.includes(END))) {
throw new Error(MISSING_MARKERS_ERROR);
}
Summary
Test plan
🤖 Generated with Claude Code