ProjectsList returns the tool and handler for listing GitHub Projects resources.
(t translations.TranslationHelperFunc)
| 151 | |
| 152 | // ProjectsList returns the tool and handler for listing GitHub Projects resources. |
| 153 | func ProjectsList(t translations.TranslationHelperFunc) inventory.ServerTool { |
| 154 | tool := NewTool( |
| 155 | ToolsetMetadataProjects, |
| 156 | mcp.Tool{ |
| 157 | Name: "projects_list", |
| 158 | Description: t("TOOL_PROJECTS_LIST_DESCRIPTION", |
| 159 | `Tools for listing GitHub Projects resources. |
| 160 | Use this tool to list projects for a user or organization, or list project fields and items for a specific project. |
| 161 | `), |
| 162 | Annotations: &mcp.ToolAnnotations{ |
| 163 | Title: t("TOOL_PROJECTS_LIST_USER_TITLE", "List GitHub Projects resources"), |
| 164 | ReadOnlyHint: true, |
| 165 | }, |
| 166 | InputSchema: &jsonschema.Schema{ |
| 167 | Type: "object", |
| 168 | Properties: map[string]*jsonschema.Schema{ |
| 169 | "method": { |
| 170 | Type: "string", |
| 171 | Description: "The action to perform", |
| 172 | Enum: []any{ |
| 173 | projectsMethodListProjects, |
| 174 | projectsMethodListProjectFields, |
| 175 | projectsMethodListProjectItems, |
| 176 | projectsMethodListProjectStatusUpdates, |
| 177 | }, |
| 178 | }, |
| 179 | "owner_type": { |
| 180 | Type: "string", |
| 181 | Description: "Owner type (user or org). If not provided, will automatically try both.", |
| 182 | Enum: []any{"user", "org"}, |
| 183 | }, |
| 184 | "owner": { |
| 185 | Type: "string", |
| 186 | Description: "The owner (user or organization login). The name is not case sensitive.", |
| 187 | }, |
| 188 | "project_number": { |
| 189 | Type: "number", |
| 190 | Description: "The project's number. Required for 'list_project_fields', 'list_project_items', and 'list_project_status_updates' methods.", |
| 191 | }, |
| 192 | "query": { |
| 193 | Type: "string", |
| 194 | Description: `Filter/query string. For list_projects: filter by title text and state (e.g. "roadmap is:open"). For list_project_items: advanced filtering using GitHub's project filtering syntax.`, |
| 195 | }, |
| 196 | "fields": { |
| 197 | Type: "array", |
| 198 | Description: "Field IDs to include when listing project items (e.g. [\"102589\", \"985201\"]). CRITICAL: Always provide to get field values. Without this, only titles returned. Only used for 'list_project_items' method.", |
| 199 | Items: &jsonschema.Schema{ |
| 200 | Type: "string", |
| 201 | }, |
| 202 | }, |
| 203 | "per_page": { |
| 204 | Type: "number", |
| 205 | Description: fmt.Sprintf("Results per page (max %d)", MaxProjectsPerPage), |
| 206 | }, |
| 207 | "after": { |
| 208 | Type: "string", |
| 209 | Description: "Forward pagination cursor from previous pageInfo.nextCursor.", |
| 210 | }, |